can't change depth to 8bit in png

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dkudelko

can't change depth to 8bit in png

Post by dkudelko »

Hi!
Try to convert png image fromn 24bit or 32bit depth to 8bit depth, but convert.exe no return 8bit depth result.
Use ImageMagick-6.6.0-Q16 win32
And my command is like

Code: Select all

convert -colors 255 -depth 8 testimage.png testimage8bit.png
But in in ImageMagick-6.4.9-4-Q16- win32 the command works.

Have anybody a same problem? Any idea how resolve/fix it or why?

Thanks!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: can't change depth to 8bit in png

Post by snibgo »

The options are in the wrong order. Try:

convert testimage.png -colors 255 -depth 8 testimage8bit.png
or
convert testimage.png -colors 255 -depth 8 -type Palette testimage8bit.png

See http://www.imagemagick.org/Usage/formats/
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: can't change depth to 8bit in png

Post by fmw42 »

try adding -type palette for 24 to 8 bits or -type palettematte for 32 to 8bits with alpha

see also -define png:color-type=2
http://www.imagemagick.org/Usage/formats/#png

and

viewtopic.php?f=3&t=15445

and

viewtopic.php?f=1&t=15584&start=15
dkudelko

Re: can't change depth to 8bit in png

Post by dkudelko »

thanks you all, i'll try
Post Reply