[SWLUG] photo corrections help

Justin Mitchell justin at discordia.org.uk
Fri Aug 24 08:54:45 UTC 2007


On Thu, 2007-08-23 at 23:43 +0100, bascule wrote:
> i recently returned from hols and noticed that pics taken with a borrowed 
> digicam were all blue tinted, apparently because i used the wrong setting in 
> the camera - should have borrowed the manual too! - i'm wondering if i can 
> take the pics that are blue tinted and run copies of them through some 
> automated procedure that will correct the tint, they are simple holiday snaps 
> and they only have to look as though they are the right colour rather than 
> being obviously too blue, putting each pic in gimp and then learning how to 
> use gimp seems overkill, esp. as there are a few hundred of them. any 
> suggestions welcomed

i would take a guess that someone left the camera in a manual white
balance mode, so that has skewed all the colours.

in the camera, an auto whitebalance would have adjusted the red green
and blue gain so that the averages were equal, so that white would come
out with RGB values all the same.  With a manual whitebalance setting
each channel has been multiplied by a fixed value to compensate for the
colour of that light type (eq incandescant bulbs are rather orange)

to fix this you will need to adjust the colours back, to figure out the
right value by hand i would load a picture in gimp, open the Curves
editor (Tools -> Color Tools -> Curves)  you can adjust the gain of each
seperate channel by choosing Red Green or Blue (instead of Value) and
then dragging the upper left part of the graph up and down.

the other way to do it would be to find a photo that has something in it
that you -know- to be pure white.  look at the RGB values for those
white pixels.  then figure out what you need to multiply them by to make
them all equal (pick the highest one as the reference).  e.g. e0e0ff
E0 = 224, FF = 255.  255/224 = 1.14   so multiplying red and green by
1.14 will make those pixels into ffffff and correct all the other
colours too.


anyway, once you have figured out what the adjust to each colour channel
should be you can apply them en masse using a tool like ImageMagick.

for * in *.jpg
do
convert  $i -channel RG -evaluate Multiply 1.14  new/$i
done

for every file called *.jpg multiply the red and green channels by 1.14
and store the result in the new/ directory





More information about the Swlug mailing list