New comer: Quantization question

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
ian313665

New comer: Quantization question

Post by ian313665 »

Hi,

I've recently found ImageMagick and I'm reading up on how to use it. So far I'm very impressed with it's versatility as a tool and I'm shocked I haven't heard of it before!

My main area of interest is image quantization.

I want to reduce the colors of an image and then save the image in a full color format. For instance, if I reduce the colors of an image to 16 and load it in a paint program, I can see that it has a palette assigned. What I would like to do is save the image in full RGB.

The command I am currently using is:

Code: Select all

convert myImage.png +dither -colors 16 myNewImage.png
How can I alter my steps to save the output PNG in a full color RGB format?

Thanks in advance.
ian313665

Re: New comer: Quantization question

Post by ian313665 »

Oh I also forgot to mention that my image must preserve the alpha correctly.

What really impresses me about ImageMagick is that the quantization process considers the alpha channel of an image. This is my main reason for using this tool as I haven't found anything else out there to do this.

I'm not sure if that will affect anything but I just thought I'd mention it, just in case.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: New comer: Quantization question

Post by fmw42 »

ian313665 wrote:Hi,

I've recently found ImageMagick and I'm reading up on how to use it. So far I'm very impressed with it's versatility as a tool and I'm shocked I haven't heard of it before!

My main area of interest is image quantization.

I want to reduce the colors of an image and then save the image in a full color format. For instance, if I reduce the colors of an image to 16 and load it in a paint program, I can see that it has a palette assigned. What I would like to do is save the image in full RGB.

The command I am currently using is:

Code: Select all

convert myImage.png +dither -colors 16 myNewImage.png
How can I alter my steps to save the output PNG in a full color RGB format?

Thanks in advance.
try

PNG32:myNewImage.png

see http://www.imagemagick.org/Usage/formats/#png_formats
Post Reply