Optimization Stack
-
Converting straight to WebP is a very risk-free way to save disk space because WebP supports everything that PNG/GIF and JPEG images support, with lossless options.
This is however not the most optimal way to get the smallest possible images and in reality you can stack layers of optimization utilities intelligently to get much better file sizes without a visible loss of quality.There are other projects focused on the ‘best possible stack’ and some of them might even be open source/willing to share their secret recipes or willing to partner up as an upgraded module vs. just using a basic WebP conversion?
For example, I know that if you imagemagick convert util on PNG and sniff the output for ‘false’ you can confirm that it’s safe to run guetzli on the PNG making an optimized JPG prior to making the WebP result.if convert "$file" -format "%[opaque]" info: | grep -q "false"; then echo "$file has transparency" else echo "$file does not have transparency" fiSimilarly if you want to test a .GIF for animation/transparency before using guetzli you can run gifsicle.
inf=gifsicle -I "$file"if [inf | grep -q 'transparency'] || [inf | grep -q 'animation']; then echo "$file has transparency and/or animation." else echo "$file is safe to flaten with Guetzli." fi
The topic ‘Optimization Stack’ is closed to new replies.