Hello
how can i get the used colors of an image using imagemagick?
I want to reduce the colors of an image to the lowest color value, but without lost the quality.
In corel Photo Paint 5 i have the option to reduce the colors to the only needed color.
Greetings Lelldorin
Count of colors by a picture
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Count of colors by a picture
Please always provide your IM version and platform when asking questions since syntax may vary.
In imagemagick you can get the list of unique colors via
If you want to reduce the number of colors, you can use
where N is the number of final colors you want.
If you want to convert your image to match a color table, then you need to create an image what contains only the colors you want, then
See also
http://www.imagemagick.org/Usage/quantize/#remap
If you are using IM 7 rather than IM 6, then change convert to magick.
For novices, see
viewtopic.php?f=1&t=9620http://http://w ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
In imagemagick you can get the list of unique colors via
Code: Select all
convert image -unique-colors -depth 8 txt:-
Code: Select all
convert image +dither -colors N result
If you want to convert your image to match a color table, then you need to create an image what contains only the colors you want, then
Code: Select all
convert image +dither -remap colortableimage result
http://www.imagemagick.org/Usage/quantize/#remap
If you are using IM 7 rather than IM 6, then change convert to magick.
For novices, see
viewtopic.php?f=1&t=9620http://http://w ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/