I'm doing some small work on a Haskell FFI to MagickWand - not my initiative, just trying to help a little.
I recently implemented a binding to MagickOptimizeImageLayers. I was expecting it to be equivalent to using `-layers Optimize` on the command line, for example using this free image as input in.gif, if I do
Code: Select all
convert in.gif -coalesce -resize 240x180 -layers Optimize out.gif
If I do the same using`MagickOptimizeImageLayers`, I get a much larger file.
(n.b. I use the `cubicFilter` when doing the resize in Haskell to match what convert is using on the CLI according to `-set options:filter:verbose 1`)
So, is there more going on when using `-layers Optimize`?
This suggests that `-layers Optimize` does a framewise optimization and transparency optimization.
The API docs suggest that there's also a MagickOptimizeImageTransparency as well as MagickOptimizeImageLayers - is this the missing part? My version of imagemagick is 6.7.7 which, I believe, is before MagickOptimizeImageLayers was included, though, so I don't think that's what's happening.
Any advice?