Home | Tutorials | Links | Contact

Local Contrast Enhancement

This method was developed by a photographer named Jay (thejaybird) at www.dpreview.com forums. I tried to translate Jay's instructions from Photoshop to GIMP.  It is quite complex and will probably take you a long time to finish but the end results are worth all the work. Included are a lot of images to help you understand it. Unfortunately GIMP has no maximum or minimum filters but they can be laboriously duplicated using Value Propagate or Dilate and Erode filters.

image 01

1. Open original color image.

2. Image > Mode > Grayscale.

3. Duplicate original image TWICE. You will now have three images.

image 02

4. Open second image and change layer's to "more white".

image 03

5. Apply Filters > Distorts > Value Propagate: Check more white, lower threshold 0, upper threshold 255, propagate rate 1. Check to left, to top, to right, to bottom.

image 04

6. Repeat Value Propagate a total of 32 times! This image is 1905 x 2888 pixels, probably for smaller images you should repeat this process less times. And I guess that larger images will need more than 32 repetitions. Maybe even this image needed additional reps. You will need to experiment. Count carefully and open the undo history dialog trying to remove operations every now and then to avoid using too much RAM. Also remember to use Ctrl+f to repeat filters.

image 05

7. Open third (last) image and change layer's name to "more black".

image 06

8. Apply Filters > Distorts > Value Propagate: Check more black, lower threshold 0, upper threshold 255, propagate rate 1. Check to left, to top, to right, to bottom.

image 07

9. Repeat Value Propagate the same as last time, 32 times.

image 08

10. Instead of using Value Propagate you can also use Filters > Generic > Dilate / Erode.

11. Open second image "more white" and apply gaussian blur using the following formula : Y(.70) x 3.2727273 =  (were Y is the number of times  Value Propagate was repeated). For this particular image 32 x 0.70 x 3.2727273 = 73.3. So the blur radius will be 73.3.

image 09

12. Once you apply gaussian blur then duplicate this image. You will have a total of four images.

image 10

13. Open third image "more black" and apply the same amount of gaussian blur as in step 11 (73.3 blur radius).

image 11

14. Go to Edit > Copy.

15. Open first image. Edit > Paste and create a new layer. Change upper layer mode to difference.

image 12

16. Now open fourth image (the last one). Edit > Paste and create a new layer. Change upper layer mode to difference.

image 12a

16B. Then flatten image and Colors >invert. You will get an image like this:

image 12b

16C. Edit > Copy.

17. Open first image. Edit > Paste and create a new layer. Change upper layer mode to dodge.

image 13

18. Duplicate Background layer and move background copy to top of layer stack. Add a layer mask to top layer, then Edit > Paste and anchor the floating layer to the layer mask. Note that the third layer (pasted layer #1) and the top layer's layer mask are the same. Halos and excess contrast will be reduced.

image 14

19. Close fourth image. You will not need it anymore.

20. Open second image "more white". Duplicate layer and apply gaussian blur to upper layer using this formula: Y x 3.2727273 = (where Y is the number of times  Value Propagate was repeated). For this particular image 32 x 3.2727273 = 104.7. So the blur radius will be 104.7. Top layer Colors >Invert, change layer mode to grain merge then Colors > Brightness / Contrast: Brightness=+2, Contrast=+1 (trying to duplicate as close as possible Photoshop's high pass filter).

image 15

21. Edit > Copy Visible.

22. Open first image. Edit > Paste. Create new layer and change layer mode to overlay.

image 16

23. Open third image "more black". Duplicate layer and apply gaussian blur to upper layer using this formula: Y x 3.2727273 = (where Y is the number of times  Value Propagate was repeated). For this particular image 32 x 3.2727273 = 104.7. So the blur radius will be 104.7. Top layer Colors >Invert, change layer mode to grain merge then Colors > Brightness / Contrast: Brightness=+2, Contrast=+1 (trying to duplicate as close as possible Photoshop's high pass filter).

24. Edit > Copy Visible.

25. Open first image. Edit > Paste. Create new layer and change layer mode to overlay.

image 17

26. This last two layers usually help to reduce halos even more.

27. You can now close the second and third images. You will not need them anymore.

28. For this particular image I still saw some halos so I did the following:

29. Duplicate Background layer and raise this duplicate to top of layer stack. Add a white layer mask. Paint with black soft brush areas where you want the local contrast enhancement. For this image I painted only the horse, leaving out the background and base.

image 18 

30. Flatten image.

image 19

31. Now the image needs sharpening.

32. Duplicate background layer twice. You will have three layers.

33. Top layer gaussian blur 20 blur radius (most of the time I use values between 10 and 20). Colors > Invert. Opacity 50.0%.

34. Layer > Merge Down.

35. Colors > Levels : Left arrow 70, right arrow 185.

image 20

36. Change top layer mode to overlay.

image 21

37. Flatten image.

38. Duplicate layer. Filters > Enhance > Unsharp Mask: Radius = 50.0,  Amount = 0.50. Add white layer mask. Paint on layer mask with black soft brush to cancel halos and overblown highlights. Vary layer's opacity to personal taste.

image 22

39. Flatten image.

40. For color image change image mode to RGB.

41. File > Open as Layers, original color image.

42. Change top layer mode to color.

image 23

43. Flatten image.


All photos and lessons on this site are Copyright©2008 Eduardo Gonzalez.