command line convert with indexed colors

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
RC123

command line convert with indexed colors

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: command line convert with indexed colors

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: command line convert with indexed colors

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply