color correction

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
ianboag
Posts: 3
Joined: 2015-03-04T00:41:33-07:00
Authentication code: 6789

color correction

Post by ianboag »

I have a camera taking pictures with a consistent magenta cast.

When I load the pix into PSPro and do red -10 and green +10 they come out just right. How do I get IM to do that?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: color correction

Post by snibgo »

I don't know what units PSPro uses, so try something like:

Code: Select all

convert in.png -channel R -evaluate Multiply 0.7 -channel G -evaluate Multiply 1.3 +channel out.png
Play with 0.7 and 1.3 until it looks right.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: color correction

Post by fmw42 »

I have moved this topic to the Users forum, since it directly relates to IM commands.

If one assumes the values from your tool are percents, then I would try:

Code: Select all

convert in.png -channel R -evaluate Multiply 0.9 -channel G -evaluate Multiply 1.1 +channel out.png
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: color correction

Post by snibgo »

Thanks Fred.

Perhaps the PSPro numbers are 10 out of 256, which is 3.9%, so the factors would be 0.961 and 1.039.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: color correction

Post by fmw42 »

snibgo, that is also a good set of values to try. Obviously none of us know that PSPro values are in actuality. So as you said before, the OP should test these values and adjust appropriately. Use the compare function to see how different the image from PSPro is from the iM result and modify your values in IM until you get as close as you want. See http://www.imagemagick.org/script/compare.php and http://www.imagemagick.org/Usage/compare/

If PSPro allows one to use any image, then one way to get the exact results for IM is to create a PNG or TIFF HALD image in IM, take it to PSPro and apply the same values and save as PNG or TIFF. The bring it back to IM and use the -hald-clut command to apply that modified hald image to his actual image. See http://www.imagemagick.org/Usage/color_mods/#hald-clut
Post Reply