I'm trying to create a smartphone application on iOS/Android that uses image processing.

I'm experiencing the following problem: when I am recording and a new object (mostly white) enters the screen, the lighting changes. I've tried to modify the focus, the white-balancing mode and the exposure but none of them are able to maintain the lightning constant.

Does anybody have an idea on how to do that ?

  • \$\begingroup\$ Do you mean the physical object influences the lighting in the scene, or that the exposure automatically changes and you would like to lock it? If the latter, this is an iOS and Android API programming question and not really something we can answer here. \$\endgroup\$
    – mattdm
    Oct 3, 2012 at 16:40
  • \$\begingroup\$ @bbking I think that you meant the OP rather than me... \$\endgroup\$
    – Francesco
    Oct 4, 2012 at 5:52
  • 1
    \$\begingroup\$ @iNovAction Services As brought up here: photo.stackexchange.com/questions/27686/… a phone isn't designed to change the aperture/shutter like a DSLR. BUT, changing the ISO and/or refresh rate of the sensor is the only real way to achieve substantial exposure. Man that's annoying. Other people modifying other people's questions. \$\endgroup\$
    – BBking
    Oct 4, 2012 at 6:10
  • \$\begingroup\$ With a Samsung Galaxy S3 (or iPhone 4S) you can lock the exposure so everything is ok ! Thanks \$\endgroup\$ Oct 14, 2012 at 17:03
  • 2
    \$\begingroup\$ This question appears to be off-topic because it is about programming a camera app, and the limitations are due to the API exposed to the programmer (the camera exposure is set at a different level), and so this is really a question about how to use a different API or otherwise work around that in software, not anything to do with photography directly. \$\endgroup\$
    – mattdm
    Jan 1, 2014 at 17:22

1 Answer 1


If I understand you right you have your camera on your phone and you're composing the picture and when something bright enters the screen the lighting 'appears' to change (probably the whole screen gets darker).

The camera will adjust what it thinks the shutter/aperture/iso should be to get the "proper" lighting. How does it know what the proper lighting is? It thinks the frame should average out to 18% grey (tones, color doesn't matter). This 18% works for "most" pictures, but if you have a predominately white/light image it will appear dark and vice versa for dark images appearing bright (blacks appear grey).

The fix is that once you figure out what the "proper" exposure is (a grey card can help) then you lock in your ISO/shutter speed/aperture and then as you move about and zoom in/out and change the proportions of the screen that are light or dark then it won't change. This is why people shoot in manual (one of the reasons anyway).

Edit: you can see a similar question here Can the camera select wrong exposure just because of color?

  • \$\begingroup\$ The camera is fixed. I've tried to put the exposure at the minimum level or even remove it and it doesn't work. Look here : developer.android.com/reference/android/hardware/… \$\endgroup\$ Oct 3, 2012 at 15:17
  • \$\begingroup\$ If you're using exposure compensation (which means you're offsetting what "correct" exposure looks like) then you'll still have the same issue. You might need to look at exposure-lock. Basically, you need to remove the phone's ability to adjust the shutter/aperture/ISO. \$\endgroup\$
    – tenmiles
    Oct 3, 2012 at 17:56
  • \$\begingroup\$ Thanks for your answer. I've looked on the API and I cannot control exposure. However I could do post processing by comparing a know zone in all images. Do you know how the lightning is distributed inside the images ? Is it uniform ? Can i fix that by modifying the HSL values ? \$\endgroup\$ Oct 4, 2012 at 19:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.