• Resolved WolfgangHammersmith

    (@wolfganghammersmith)


    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"
    fi

    Similarly 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
Viewing 1 replies (of 1 total)
  • Plugin Author kubiq

    (@kubiq)

    Hello,

    I’m not sure what you’re trying to tell in that part with transparency and png to jpg things. There is almost no difference if you create webp from jpg or png . There is no need to check transparency, because webp supports transparency same as png.

    Next thing with gifsicle is a great idea, but I’ve never heard about this and I think it will not work on most servers. If I understand this correctly, then to be able to run this in PHP, server would need to support shell_exec which in my experience most servers have disabled for a security reason.

    Ofc, we can try something, if you’re willing to share some snippets or more info, but right now I don’t have enough free time to make some research and test this unfortunately.

Viewing 1 replies (of 1 total)

The topic ‘Optimization Stack’ is closed to new replies.