Script - Dynamic Range - evens out lighting in an image

Moderator: Kathy_9

Post Reply
Posts: 2654
Joined: Fri Mar 28, 2008 10:04 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
Location: Canada

Script - Dynamic Range - evens out lighting in an image

Post by JoeB »

I'm posting this script, called Rusty's New Dynamic Range Script, as a result of a request in a thread where user @okyou asked for help in creating a more even lighting for an image where the left side of the image was less illuminated than the right. That thread is here:


The script was created by Peter Anderson back when PSPX1 was the latest version, but should work with all versions. The stated purpose of the script is to increase the dynamic range of an image. The practical purpose is to even out the dynamic range of an image where the lighting is uneven in a gradual way. The major perceptual effect is to make the darker areas lighter and the lighter areas darker, and it affects the entire image.

Before running the script I suggest that you make a duplicate layer of the image you are trying to fix and run the script on that duplicate. This will allow you the extra tweaking options after your have used the script of experimenting with blend modes for that layer with the original below it that might improve the final result.

The script creates a duplicate of the layer you're working on, which duplicate layer acts as an adjustment layer. The script's actions result in a gaussian blurred negative image layer (which is named RDR in the Layers palette) that, essentially, provides more exposure to the darker areas of the underlying layer and less exposure to the lighter areas.

Also, the RDR layer is in Overlay mode, and defaults to 50% opacity. Increasing this opacity increases the effect on the underlying layer, and decreasing it decreases the effect. When you achieve the lighting effect you're looking for, you can merge the RDR layer with the underlying layer, and then you can do further tweaking that might be necessary. Because it affects overall lighting, once you have merged the RDR layer with the underlying layer you might, for example, find you want to now increase the overall brightness and/or contrast, maybe use Clarity, perhaps sharpening, etc.

Alternatively, prior to trying those aforementioned tweaking options, you can first try changing the blend mode of that duplicated layer to Lighten. Depending on the extent of how the script might have made lighten/darken or color changes to the lighter parts of your image, this MIGHT help to correct those. You can play with the opacity of that layer with Lighten selected to see if it helps. If it does, then merge that layer with your original and apply any of the other tweaks mentioned.

The script doesn't work miracles so don't expect to get the best results if part of the image is really dark and other parts really light (but using the blend mode tweak above can sometimes give even better results), but it works quite well on many ordinary uneven lighting situations as you can see from the the image I posted in the original thread after applying the script (link above).

You can place the script in your Scripts Restricted folder once unzipped.
Rusty's New Dynamic Range
Rusty's New Dynamic Range Script
(1016 Bytes) Downloaded 94 times

Using PSP 2019 64bit
Post Reply