A client commissioned me, as an "extra" at the end of a portrait job, to take pictures of graffiti on their stairs walls. in the flat grey area there is a bird painted (censored).

Setting up flashes and turning off lights were not viable options.

To the question: how can i normalize exposure (and if possibile, but less important, color balance) through the frame in a sort of automated way?

The logic sound pretty clear to me:

  1. subject can be quickly filled in with content-aware
  2. get rid of wall texture through blur
  3. for each pixel there must be an offset which leads to 90% grey
  4. apply the same "offset mask" to the original layer so that also subject gets the same correction.

Point 1 and 2 are clear and can also be quickly automated: any help with points 3/4 would be amazing!



  • \$\begingroup\$ I have no idea what you're talking about. \$\endgroup\$
    – osullic
    Mar 30 at 14:33

3 Answers 3


My usual technique for this (with Gimp, I don't know if PS has the same filter):

  • Do a wavelet decomposition
  • Replace the bottom layer of the decomposition (which is the very low frequency component), with its own average (it other words, blur it or pixelize it to one "pixel")

enter image description here

There is an older technique, that works with both Gimp and PS, and which is pretty much what you describe when you look at the math involved:

  • Make a copy of the layer and blur it until there is no detail left
  • Set the blurred layer to "Grain extract" mode
  • If necessary add back some contrast/luminosity with Levels

enter image description here

  • \$\begingroup\$ thanks for your reply! however I feel like I didn't really explain myself well: there is a bird painting which I censored in the flat grey area. light is inconsistent across the frame so my idea is to set a target for each pixel, blur until i lose the texture, average the "subject" area, extract the brightening/averaging mask and apply it to the original layer, thus basically cutting out and auto-editing the image! \$\endgroup\$ Mar 30 at 17:36
  • \$\begingroup\$ I usually apply both techniques will the subject still in place and not censored out. The subject has enough high frequency component to remain. Also,I don't see how you r algorithm can work if you replace the texture in the subject by something else, the offset you will get will apply to the pixels of replacement texture and not to the subject texture, so when combined with the subject it will likely worsen the problem. \$\endgroup\$
    – xenoid
    Mar 30 at 19:51

Using your method in Gimp with layer groups and adequate blend modes

enter image description here

It works quite well on the wall, but if you emulate the subject by pasting a bit of the original wall (ellipse), you see that the color correction doesn't apply and you get color smears.

Still, it is pretty much the same as the Grain extract method, the difference being that you force in advance the average level of the output, while GE will set it to some middle gray.


I'm not entirely certain this does what you want, but I used a technique called frequency separation in Photoshop. But first I added a bird back into your image and created an obvious WB/color issue...

enter image description here

  • duplicated the original layer as backup (not required)
  • "select subject" on duplicate layer to select the bird and then cut/pasted it to a new layer
  • duplicate the (now empty) BG layer
  • select the bottom BG layer and apply a heavy blur to remove texture
  • select the duplicated (top) BG layer and "apply image" in subtract mode with the blurred BG layer as the reference (this creates a greyscale detail layer)
  • use a curves adjustment layer to set the cut out section of the apply image detail layer to white (this area will always be mid grey; could also use levels or exposure)
  • select the subject layer and select image>auto color from the Image menu (move layer to top if not already there)
  • turn off visibility of the original and blurred BG layers (not required)

This is the result:

enter image description here

All of this could be recorded as an action and then applied automatically, or even in batches. But any "auto" function is likely to have issues at times (e.g. select subject, auto color).

There are many tutorials on using the frequency separation technique online... the only thing different here is that I left the apply image detail layer in the normal blend mode.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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