ImageMagick / Usage-Markdown

Base text document processed with pandoc
12 stars 13 forks source link

Expand Behavior of PNG Compression #22

Open emcconville opened 8 years ago

emcconville commented 8 years ago

Folks may need additional clarity on how compression quality works (-quality) for the PNG format.

Section "PNG Compression" under formats should be expanded to included the behavior outlined in png.c.

  /* Untangle the "-quality" setting:
     Undefined is 0; the default is used.
     Default is 75
     10's digit:
        0 or omitted: Use Z_HUFFMAN_ONLY strategy with the
           zlib default compression level
        1-9: the zlib compression level
     1's digit:
        0-4: the PNG filter method
        5:   libpng adaptive filtering if compression level > 5
             libpng filter type "none" if compression level <= 5
                or if image is grayscale or palette
        6:   libpng adaptive filtering
        7:   "LOCO" filtering (intrapixel differing) if writing
             a MNG, otherwise "none".  Did not work in IM-6.7.0-9
             and earlier because of a missing "else".
        8:   Z_RLE strategy (or Z_HUFFMAN_ONLY if quality < 10), adaptive
             filtering. Unused prior to IM-6.7.0-10, was same as 6
        9:   Z_RLE strategy (or Z_HUFFMAN_ONLY if quality < 10), no PNG filters
             Unused prior to IM-6.7.0-10, was same as 6
    Note that using the -quality option, not all combinations of
    PNG filter type, zlib compression level, and zlib compression
    strategy are possible.  This will be addressed soon in a
    release that accomodates "-define png:compression-strategy", etc.
   */