Page 1 of 1

match colors like in Photoshop?

Posted: 2013-10-09T10:13:05-07:00
by airBourne
Hey guys,
Is there an ImageMagick feature/routine which will enable me to match the colors of one image to a second image? I'm looking for something similar to the Photoshop 'match color' tool referenced here:

http://www.peachpit.com/articles/article.aspx?p=706213

My situation: I have an image mosaic of Color-infrared aerial photographs for which I've used ImageMagick to process. However, the final processing step as suggested by the manufacturer of our camera is to take our image mosaic and match the colors to an existing CIR aerial photograph for a final product. I have an old version of Photoshop that doesn't have this feature--and I'd prefer to avoid Photoshop anyhow--and was wondering if this were possible with ImageMagick.

Thanks!!

Re: match colors like in Photoshop?

Posted: 2013-10-09T11:27:57-07:00
by snibgo
The article doesn't say what PS actually does.

You can recolour an image so every pixel becomes as close as it can to a colour in another image:

Code: Select all

convert in.png reference.png -dither -remap out.png
If this doesn't do what you want, can you provide sample images?

Re: match colors like in Photoshop?

Posted: 2013-10-12T06:04:41-07:00
by rich2005
Is that correct?

Using convert in.png reference.png -dither -remap out.png

I get an error
convert: unrecognized dither method `-remap' @ error/convert.c/ConvertImageCommand/1285

Looking at the documents -dither takes a switch so

convert in.png -dither None -remap reference.png out.png

works

but what is your advice on the dither options? None/Riemersma/FloydSteinberg (any others?)

Using PClinuxOS and ImageMagick 6.8.0-2 2013-04-13 Q16

Re: match colors like in Photoshop?

Posted: 2013-10-12T10:16:45-07:00
by fmw42
but what is your advice on the dither options? None/Riemersma/FloydSteinberg (any others?)
I do not think there is any best method. Just try each and use whatever looks best for your image.

-dither none is like no dithering or +dither, so for dithering you only have two choices. I am not sure which is used by default.

Re: match colors like in Photoshop?

Posted: 2013-10-13T08:27:30-07:00
by snibgo
Gosh, I fouled up the syntax badly. That should have been:

Code: Select all

convert in.png -remap reference.png out.png
See http://www.imagemagick.org/script/comma ... ptions.php

Re: match colors like in Photoshop?

Posted: 2013-10-22T20:59:55-07:00
by fmw42
Perhaps it is doing something like my histmatch script. However, some tests seem to show that -remap seems to work better.