Page 1 of 1

command line convert with indexed colors

Posted: 2010-05-19T07:48:13-07:00
by RC123
I need to find the command line options to convert an image to an indexed gif image.

I can't get any commands to work to index the colors. All of the examples from the tutorials, etc., give an error message. For example the following command lines give errors:
c:\convert c:\myfile.png -dither -colors 256 c:\myfile.gif
c:\convert -dither -colors 256 c:\myfile.png c:\myfile.gif
Any help would be greatly appreciated.
Thanks

Re: command line convert with indexed colors

Posted: 2010-05-19T08:15:43-07:00
by snibgo
Your command gives the error:
convert: unrecognized dither method `-colors' @ error/convert.c/ConvertImageCommand/1252.
This is because "-dither" needs a method. Type "convert -list dither" to see what methods you can use.

If you copied this invalid command from a web page, you might give its URL so it can be corrected.

Re: command line convert with indexed colors

Posted: 2010-05-20T21:38:11-07:00
by anthony
To use a specific set of colors you would use -map image_with_indexed_colors.gif

See IM examples, Color Quantization and Dithering for more help
http://www.imagemagick.org/Usage/quantize/#map