# Compression Commit
This commit performs both lossless and lossy compression on every .obj and .png in homedecor. The .png files were all 100% losslessly compressed using ect.exe and optipng.exe (more details below) at maximum settings. The .obj files were lossy-compressed so that comments were removed, trailing 000's were removed and all numbers rounded to 3 decimal places max. Blender exports at 6 decimal places but for minetest, 3 decimal places is the absolute maximum a person with anything under a 256K screen will ever need. ## Results ``` Original entire modpack size: 6343.5 KB New entire modpack size: 5312.2 KB Total Reduction: 1031.3 KB (16.3% less) ``` Please note that actual media size is likely more like 4,500 KB so media reduction is more around 20-25%. ## Details / What actions were actually performed Used these programs: https://github.com/ExeVirus/Compress-Obj https://sourceforge.net/projects/optipng/ https://github.com/fhanau/Efficient-Compression-Tool Ran this command on every .obj: (fast) ``` luajit.exe compress.lua -f <file> -precision 3 ``` Ran these commands on every .png: (slow) ``` ect.exe -9 -strip --allfilters-b <file> optipng.exe -o7 -strip all -clobber <file> ``` Note that for future compression, I recommend only using optipng.exe instead of both. ECT can get better results but it takes a LOT longer and only ever saves another 1-2% of the file size. Not worth an extra 10-20 seconds per texture file in my opinion. ## Time spent Roughly 2 Hours from start to finish + commit + PR
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 430 B After Width: | Height: | Size: 419 B |
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 129 B After Width: | Height: | Size: 127 B |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 580 B After Width: | Height: | Size: 564 B |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.0 KiB |