I know that to find out the number of colors in image I can use
$identify -format "%k" file
In grub boot loader we can set image as background of menu but the restriction is image should be 640x480 ( resizing I know ) and have not more than 16 colors ( preferred 12 ) .
Currently I use gimp in which I do image > mode > indexed & set palette to 12.
[question]how can I use command of imagemagick to do this ?
using fixed number of colors in image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: using fixed number of colors in image
try
convert image -resize ... +dither -colors 12 -type palette result.gif
convert image -resize ... +dither -colors 12 -type palette result.gif
Thank You. It worked .
If I don't use +dither then I get 5 colors
and if I use +dither then I got 10 though palette given as 12 in both.
I will read http://www.imagemagick.org/Usage/quantize/
Should I read anything else to understand better ?
and if I use +dither then I got 10 though palette given as 12 in both.
I will read http://www.imagemagick.org/Usage/quantize/
Should I read anything else to understand better ?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Thank You. It worked .
-colors does not enforce exact number of colors, but sets the maximum it will produce.manit wrote:If I don't use +dither then I get 5 colors
and if I use +dither then I got 10 though palette given as 12 in both.
I will read http://www.imagemagick.org/Usage/quantize/
Should I read anything else to understand better ?
the reading on quantize is the only one I know apart from http://www.imagemagick.org/script/quantize.php which is linked inside that page
Re: using fixed number of colors in image
Add -treedepth 8 to your command line.