04 February, 2011

Correcting the iPhone's camera problem

I noticed that sometimes, the colour in pictures taken by the iPhone 4 camera was funny, but I never thought of it as a problem until I read about it online.
For me, pictures taken under fluorescent light have a green circle in the centre and a pink tint at the edges. Since this colouration is in the same position in all pictures, I immediately thought it would be easy to fix by taking a calibration image, like they do with astronomy pictures. Strangely, I couldn't find any posts on this. Maybe people who use Photoshop don't use the iPhone 4? There's hope for this post to become the top hit in a search then.
I took a simple picture of a white sheet, trying to make lighting as even as possible. It's similar to taking a dust reference image in DSLRs to compensate for dust on the sensor. It's actually best if the picture is out of focus.
Ideally, I would like to divide each pixel value in the target image by the value of the same pixel in the reference image, but I don't know how to do this in Photoshop. I found another method that works in only 3 steps:
Invert the calibration image
Paste it as a new layer over the target
Change the blending mode to "Color Dodge". "Linear Dodge (Add)" also works, I'm not sure what's the difference between the 2. This method isn't dividing the values like we want, so it's not ideal.
The resulting image is a bit too bright, but this is easily fixed by adjusting the levels of the calibration layer. Feel free to try for yourself using my pictures.

Whether the calibration image works depends on the tint, which depends on the phone. Apparently there are different tints, and some phones produce tints in different situations. You'll get the best results by taking your own calibration image. My phone only seems to have 1 type of tint, since this calibration image works for this image I took 6 months ago.
In the corrected image, I adjusted the levels of the correction layer to 86 0.73, for the first 2 numbers in the levels dialog box. Here a flaw in the calibration image shows up. The top of the corrected image is uncorrected, while the bottom is overexposed. Although it's not obvious by looking at it, the lighting in the correction image is not even.

No comments:

Post a Comment