zlib filtering PNGs

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
Uyenvu123
Posts: 1
Joined: 2019-09-25T20:43:27-07:00
Authentication code: 1152

zlib filtering PNGs

Post by Uyenvu123 »

Hi guys

I am writing some code to improve the compression of PNGs and I am having some difficulties with PNGs that have been edited with the GIMP (as JPEGs) and then transformed into PNGs on the fly by Perl Magick.

Essentially, if I turn on Z_FILTERED in the compression code the PNGs will not display, though a casual look over them in a hex editor reveals no problem.

If Z_DEFAULT is used then there is no problem... sorry to be vague about this but I really don't know why this happens and wonder if anyone could give me some clues to what might be up?

Uyen
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: zlib filtering PNGs

Post by fmw42 »

Please always provide your ImageMagick version and platform and the exact command(s) you used.

I do not see any option for compression called Z_filtered.

Code: Select all

convert -list compress
B44A
B44
BZip
DXT1
DXT3
DXT5
Fax
Group4
JBIG1
JBIG2
JPEG2000
JPEG
LosslessJPEG
Lossless
LZMA
LZW
None
Piz
Pxr24
RLE
RunlengthEncoded
WebP
ZipS
Zip
Zstd
See https://imagemagick.org/Usage/formats/#png_write for PNG output defines to control compression.
Post Reply