color quantization/dithering 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
marshmallow

color quantization/dithering question

Post by marshmallow »

Hi,

I have a question on the best way to reduce the number of colors in an image for a textile project that I am working on. I have an RGB image that I would like to reduce down to 40 or so colors, where the chosen colors come from a palette of about 450 thread colors. I have rgb color values for each thread color. Is there a way to do this with IM? I've read the examples and it's not clear to me whether the map function works with an image that contains more than 256 colors.

Thanks,

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

Re: color quantization/dithering question

Post by fmw42 »

-map (or -remap), I believe, will work on more colors than 256. Your colormap will decide how many colors you get in the end. You can then try to reduce the colors after the -map by using +dither -colors 40, but there is no guarantee that the colors will remain in your palette or that you will get 40 exactly, as I understand it. You may be best to reduce your colortable to 40 first and then skip the -colors 40 step.
marclallen

Re: color quantization/dithering question

Post by marclallen »

Because I've simplified the problem to show the -set delay not working.

In reality, I had a \( -clone 0 \) before the stack with the -set delay 10. This cloned image was not deleted and had the full 5 seconds.

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

Re: color quantization/dithering question

Post by fmw42 »

marclallen wrote:Because I've simplified the problem to show the -set delay not working.

In reality, I had a \( -clone 0 \) before the stack with the -set delay 10. This cloned image was not deleted and had the full 5 seconds.

Marc

The above is a reply to the wrong topic. But I understand. Perhaps you need to provide your proper command that worked before and an example or change your example to something that will demonstrate your real problem.
marclallen

Re: color quantization/dithering question

Post by marclallen »

How the heck did that happen? I'm so sorry.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: color quantization/dithering question

Post by fmw42 »

marclallen wrote:How the heck did that happen? I'm so sorry.

No problem, as I was attending to both issue. So I knew what happened.
Post Reply