I noticed that -colors seems to create new colors that are not in the original image.
Is there a way to make it use only the colors that were there, and if not can someone recommend me a tool that can?
Would doing a remap afterwards with the original image still give good results?
EDIT: Doing a remap afterwards gives more than 2 colors, and turning off dither produces horrible results
Reduce number of colors without creating new color
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Reduce number of colors without creating new color
I am surprised that "Doing a remap afterwards gives more than 2 colors". Can you supply sample command and image?
You could:
(1) Find the N most common colours in the image. Make an image containing just those colours.
(2) Remap with the image found from (1).
IM doesn't (yet) contain tools to convert histogram data into images, so step (1) involves a script.
You could:
(1) Find the N most common colours in the image. Make an image containing just those colours.
(2) Remap with the image found from (1).
IM doesn't (yet) contain tools to convert histogram data into images, so step (1) involves a script.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Reduce number of colors without creating new color
I do not understand. -remap should maintain the colors in the colormap image. Cay you provide an example our your input and output and exact command line. Images can be uploaded to some free hosting site such as dropbox.com (public folder) and you can put the URL her.
Edit: Sorry snibgo, we were posting at the same time.
Edit: Sorry snibgo, we were posting at the same time.
Re: Reduce number of colors without creating new color
- adladl.png
- new.png Has new color
- new2.png Has three colors
- new3.png Is not dithered
- new.png Has new color
- new2.png Has three colors
- new3.png Is not dithered
Code: Select all
convert adladl.png -colors 2 new.png
convert adladl.png -colors 2 -remap adladl.png new2.png
convert adladl.png -colors 2 +dither -remap adladl.png