Problem with -depth on PNG images
Posted: 2018-10-15T00:06:38-07:00
I'm trying to do a simple reduction of the depth of some grayscale images (of text) that I have. They're in PNG format. When I use a depth of 2 or 3, the entire image gets compressed into the left side of the canvas, leaving the side half black. It only seems to happen with gray PNG files. I can reproduce it via
In this case the image is compressed into the left half of the canvas. If I make the depth 2, then the image is compressed into the leftmost quarter of the canvas. A depth of 1 is fine.
NB If I output to show: as PNG:, I get the same error:
Perhaps something with writing to PNG?
Tested OK with jpg and tiff output formats.
MacOS 10.13.6
Version: ImageMagick 7.0.8-12 Q16 x86_64 2018-09-24 https://imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib fftw fontconfig freetype jbig jng jp2 jpeg lcms ltdl lzma png tiff x xml zlib
Code: Select all
magick logo: -colorspace gray -depth 3 logo.png
NB If I output to show: as PNG:, I get the same error:
Code: Select all
magick logo: -colorspace gray -depth 3 png:- | display -
Tested OK with jpg and tiff output formats.
MacOS 10.13.6
Version: ImageMagick 7.0.8-12 Q16 x86_64 2018-09-24 https://imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib fftw fontconfig freetype jbig jng jp2 jpeg lcms ltdl lzma png tiff x xml zlib