Page 1 of 1

[SOLVED] fully specifying the png compression method

Posted: 2012-10-05T10:55:46-07:00
by NicolasRobidoux
If I understand correctly, the png compression system is defined by 3 numbers.
For example, here is some pngcrush output:

Code: Select all

  Total length of data found in IDAT chunks    =   348784
unknown chunk handling done.
   IDAT length with method   1 (fm 0 zl 4 zs 0) =   223599
   IDAT length with method   2 (fm 1 zl 4 zs 0) =   248123
   IDAT length with method   3 (fm 5 zl 4 zs 1) =   385096
   IDAT length with method   4 (fm 0 zl 9 zs 1) =   323957
   IDAT length with method   7 (fm 0 zl 9 zs 0) =   212899
   Best pngcrush method = 7 (fm 0 zl 9 zs 0) for temp.png
Now, "fm 0 zl 9" corresponds to "-quality 90" (they are in the opposite order) in ImageMagick.
Is there a way of setting zs as well?

Re: fully specifying the png compression method

Posted: 2012-10-05T15:24:09-07:00
by glennrp
Yes. Instead of -quality, use
  • -define png:compression-strategy=zs
    -define png:compression-level=zl
    -define png:compression-filter=fm
for complete control over the compression

Re: fully specifying the png compression method

Posted: 2012-10-05T16:13:45-07:00
by NicolasRobidoux
Thank you Glenn.

Re: [SOLVED] fully specifying the png compression method

Posted: 2012-10-10T17:00:06-07:00
by anthony
Added to IM Examples, Formats, PNG, Writing Controls
http://www.imagemagick.org/Usage/formats/#png_write