Page 1 of 1

Removing orange tint-mask from color-negatives

Posted: 2009-06-25T06:00:41-07:00
by bablokb
Hello,

how can I remove the orange tint-mask from color-negatives with IM? I found one reference to gimp
http://www.freecolormanagement.com/colo ... nning.html which might give a hint. Probably one has to set the color of the tint-mask manually somewhere on the commandline - or is there maybe a sort of color-picker in IM?

Thanks, Bernhard

Re: Removing orange tint-mask from color-negatives

Posted: 2009-06-25T09:49:25-07:00
by fmw42
The problem is that he does not say exactly what method was used to "merge" the levels. Also perhaps the images he has provided have lost some quality and do not quite represent his original. Anyway here is what I have done. I cropped his image from his page and called it moth.jpg

Image

Then I measure its size:
identify moth.jpg
moth.jpg JPEG 255x386 255x386+0+0 8-bit DirectClass 26.7kb

Then I cropped the bottom 4 rows to get the color of the background:
convert moth.jpg[255x4+0+382] -scale 1x1! -format "%[pixel:s.p{0,0}]" info:
rgb(176,110,73)

His values were rgb(176,111,79). These are close to mine, but I used his.

Just for visualization, I created a swatch of that color:

convert -size 255x386 xc:"rgb(176,111,79)" moth_bgcolor.png
Image

Now process the image by compositing with the color negated

convert moth.jpg \( -size 255x386 xc:"rgb(176,111,79)" -negate \) \
-compose plus -composite \
moth_tmp1.jpg
Image

Alternately, you can do this and get the same result:

convert moth.jpg \( -size 255x386 xc:"rgb(176,111,79)" \) \
-compose minus -composite -negate \
moth_tmp1.jpg

Then equalize the result:

convert moth_tmp1.jpg -equalize moth_tmp1_equal.jpg
Image


As I said, this is not as good as his result. I suspect his original image was different/better resolution. Furthermore, I don't know exactly how he merged them. He could have used some mixing ratio rather than an equal combination.

Re: Removing orange tint-mask from color-negatives

Posted: 2009-06-26T02:01:05-07:00
by bablokb
Thanks for the nice illustrated solution. I think I will write a little script which will automate all the steps.

Bernhard

Re: Removing orange tint-mask from color-negatives

Posted: 2009-06-26T08:13:15-07:00
by fmw42
Post a couple of real examples after you finish your script and let us know any improvements in the technique (like something other than just -equalize)

Re: Removing orange tint-mask from color-negatives

Posted: 2009-06-26T11:52:50-07:00
by bablokb
Here is an improvement, which gives almost identical results to the one on the website:

Code: Select all

convert /tmp/moth.jpg \( -clone 0 -fill "rgb(176,111,79)" -colorize 100% -negate \) -compose overlay -composite -negate -normalize x:
Alternatively, instead of -fill ... -colorize 100%, +level-colors "rgb(176,111,79)" also works.

I think that +level-colors could probably do the job alone, using something like this (note the extra comma):

Code: Select all

convert /tmp/moth.jpg +level-colors "rgb(0,65,97)," -negate -normalize x:


which is close but not as good as the first convert-statement. The rgb-values are the difference to the tint-mask value of the red-channel (e.g. green: 176-111=65). I have tried different variations like using the difference to 256, but I did not succeed.

Bernhard

Re: Removing orange tint-mask from color-negatives

Posted: 2009-06-26T12:29:44-07:00
by bablokb
And finally, a very simple solution which does not need any information about the color-mask:

Code: Select all

convert /tmp/moth.jpg -negate -channel all -normalize x:
Credit: http://www.computer-darkroom.com/tutori ... al_6_1.htm. But with IM it is much simpler than with PS ;-)

This normalizes each channel seperatly, removing the blue color-cast after the first -negate. Depending on the result, it might also be necessary to add a "+channel -normalize" to do a final global normalization.

I think I will try these different solutions with a few real world scans of my color-negatives and then I will decide which is the better approach.

Bernhard

Re: Removing orange tint-mask from color-negatives

Posted: 2009-06-28T20:01:21-07:00
by anthony
Of course using -normalize is actually cheating, and will not work for ALL images.

What is really needed is the correct level adjustment for each image (linear), or histogram adjsutments (channel curves), or even a Hald CLUT (Any negate RGB to Photo RGB) for the negative type. I believe their are quite a number of negative types.