Title: Optimization Stack
Last modified: October 5, 2023

---

# Optimization Stack

 *  Resolved [WolfgangHammersmith](https://wordpress.org/support/users/wolfganghammersmith/)
 * (@wolfganghammersmith)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/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.
 *     ```wp-block-code
       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.
 *     ```wp-block-code
       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](https://wordpress.org/support/users/kubiq/)
 * (@kubiq)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/optimization-stack/#post-17149411)
 * 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.

 * ![](https://ps.w.org/images-to-webp/assets/icon-256x256.png?rev=2195047)
 * [Images to WebP](https://wordpress.org/plugins/images-to-webp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/images-to-webp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/images-to-webp/)
 * [Active Topics](https://wordpress.org/support/plugin/images-to-webp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/images-to-webp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/images-to-webp/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [kubiq](https://wordpress.org/support/users/kubiq/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/optimization-stack/#post-17149411)
 * Status: resolved