It is currently 28 Sep 2020, 19:36

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

New Luminosity Mask Plugin (The Last!)

Share your Python Fu Scripts/plug-ins for GIMP here
Post Reply
david
Forum Member

New Luminosity Mask Plugin (The Last!)

Post#1 by david » 13 Sep 2020, 10:00


I have made numerous luminosity mask plugins. They have become increasingly complex, but not achieved my aims.

After much thought, I decided to go back to basics and sketched out the requirements with paper and pencil. The result is the latest (and last!!!) plugin.
It will be found under "Python-Fu" as "Equal Luminosity Masks...".

After equalizing a copy of the original image (to compensate for low contrast images) it creates 10 masked layers, 0 to 9, with 0 being the darkest and 9 the lightest.
These are created by using 10, equal, overlapping spline curves. Each curve is at zero where the adjacent curve is at maximum, to ensure that every pixel of the original image is represented in one of the masks, or two in the overlap region. (A hand-drawn representation is attached.)

Preliminary tests on various photographs suggest that it is considerably better than all my previous LM plugins. Also, the code is much shorter than my recent attempts and runs a little faster, although I suspect that someone with Python knowledge could make it more efficient.

I have deleted all the previous versions from my gimp plugins folder as I think it is better, but I hope others will try it and give me feedback.

Comments, criticism and advice are always welcome!

david.
Masked_Layers.png
Masked_Layers.png (28.87 KiB) Viewed 554 times
sketch.png
sketch.png (33.45 KiB) Viewed 554 times
Attachments
eq_lum_mask.py
(5.69 KiB) Downloaded 2 times
Last edited by david on 25 Sep 2020, 12:33, edited 2 times in total.
0

Krikor
Forum Member

Post#2 by Krikor » 15 Sep 2020, 22:22


david wrote:
13 Sep 2020, 10:00
I have made numerous luminosity mask plugins. They have become increasingly complex, but not achieved my aims.
(...)
Comments, criticism and advice are always welcome!
Hi David,

I've been comparing the Equal Luminosity (current version) and Luminosity DM (previous version) Plugins.

I don't know if I will be able to express myself correctly, but in summary I still prefer the previous version (DM).

►The Equal version can better cover the image area to be covered by the plugin than its previous version.

►The DM version has a smoother transition between the luminosity layers.

I will try to demonstrate with the images below.

Peter Baumgarten Pictures.
Krikor - 03 exposures at the same image
Krikor - 03 exposures at the same image
3Exposures.png (191.35 KiB) Viewed 476 times
First I tried to demonstrate that both plugins do not cover 100% of the image. There are areas that are not covered, are not masked (greenish areas - the more solid green the less the image area is covered by the plugins).

For that, it was enough to create a new layer as the background of all layers and use it to reveal the areas not covered by the plugins.

This demonstrated that the current version ( Equal ) has better coverage.
krikor - % eficiency DM on Layers
krikor - % eficiency DM on Layers
CoberturaLumiDM.png (407.95 KiB) Viewed 476 times
Krikor - % eficiency Equal on Layers
Krikor - % eficiency Equal on Layers
CoberturaEqualLM.png (484.48 KiB) Viewed 476 times
I used the plugins to obtain the lightest (underexposed) areas of the darkest image (-2.0 EV), and the darkest areas of the most exposed (overexposed) image (+3.7 EV).

I created a new image of the visible result (new from visible).
I created a new image formed by the overlay of the results obtained by the plugins on the +1.7 EV exposure image.

The transition generated by the Equal version is very hard, compared to that obtained by the Plugin DM.
Krikor - Transition DM Luminosity Masks
Krikor - Transition DM Luminosity Masks
ShadowBrightDM.png (598.32 KiB) Viewed 476 times
Krikor - Transition Equal Luminosity Masks
Krikor - Transition Equal Luminosity Masks
ShadowBrightEqual.png (664.47 KiB) Viewed 476 times
Just complementing it, using Ofnuts Luminosity Masks, 100% coverage occurs, and the transition generated by the luminosities created is very smooth.
Krikor - TRansiotion Ofnuts LM
Krikor - TRansiotion Ofnuts LM
ShadowBrightOfnuts.png (599.91 KiB) Viewed 476 times
Ideally, the plugin could have the cover provided by Equal but with the DM's softness.
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston
0

david
Forum Member

Post#3 by david » 16 Sep 2020, 07:40


@Krikor

Thank you very much for your comments. It gives me exactly the information I need to improve the plugin.
I shall try increasing the overlap of the spline curves to see if that fixes the problem.

david.
0

david
Forum Member

Post#4 by david » 17 Sep 2020, 12:24


@Krikor

I have updated the file at the start of this thread.

I have changed the shape of the spline curves so that the masks give 100% coverage. For instance, mask number 2 is at a maximum from 0.2 to 0.3 and decays to zero at 0.1 and 0.4.
The masks at their maximum value occupy 10% of the brightness spectrum and 30% at their minimum value.

I am unclear as to the changes you made when you found a hard transition. Unfortunately, I was unable to find the photographs you used for your examples. It would have been useful to be able to make a direct comparison.

By increasing the overlap between masks, it should be possible to have a more gradual change between layers, but this would also make the layers less independent of each other. I can see two possibilities - to increase the overlap at 100%, or to make the masks decay to zero more gradually.
It is necessary to find the best compromise.

Your help and advice is extremely useful to me in trying to produce a plugin which is useful to you and other people.

david.
Last edited by david on 17 Sep 2020, 22:53, edited 1 time in total.
0

Krikor
Forum Member

Post#5 by Krikor » 17 Sep 2020, 19:59


david wrote:
17 Sep 2020, 12:24
@Krikor

(...) I am unclear as to the changes you made when you found a hard transition. Unfortunately, I was unable to find the photographs you used for your examples. It would have been useful to be able to make a direct comparison. (...)

david.
@David ,

I tried to highlight the explanation I gave in the previous post using an annotated image.
Basically I just:
01- Used masks 01, 02, 03, 04 and 05 on the image with -2.0 EV.
02 - Used the D1, D2, D3, D4 and D5 masks on the image with +3.7 EV.
Krikor - Resumo LM
Krikor - Resumo LM
Resumo02.png (620.97 KiB) Viewed 428 times
The images I used belong to Peter Baumgarten and can be found at:
https://learnandsupport.getolympus.com/ ... curate-hdr

I will download the modified version and try it out (maybe there is no more time today).
Thank you for your insistence and dedication to improving the plugin!
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston
0

Krikor
Forum Member

Post#6 by Krikor » 17 Sep 2020, 20:01


Before it was possible to display images without being miniaturized, as long as they were up to 1000x800.
I reduced the size of the image above to 1000x543, even so it was reduced. :-(
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston
0

david
Forum Member

Post#7 by david » 18 Sep 2020, 11:41


@Krikor

Thank you for the link to the photographs and the explanation. I saw this late last night and have yet to experiment.

I thought it may be useful to you if I updated my development script with a selection of spline curves. I have done this very quickly this morning, so I hope that I have not made any mistakes!

It gives options for 4 different mask curves: 10%/30% - that is 10% wide at maximum, 30% wide at minimum - as in my last update.
In addition there are: 10%/50%, 15%/30%, and 15%/50%.
dev_eq_lum_mask.py
(9.07 KiB) Downloaded 15 times
david.
0

Krikor
Forum Member

Post#8 by Krikor » 18 Sep 2020, 20:12


@david ,

I confess that I found the use for the 4 options of curves for the masks not very intuitive. But ok, I tested all 4 and I could see the different results for each option available.

At least for the purpose for which I was testing the plugin, I was more satisfied with the option 15% 50%.

Between the Equal version and Dev Equal I noticed a noticeable improvement. The spectrum reached was expanded and there was a greater smoothing in the generated masks.
I would need to play for longer and with more images to be able to have a better opinion, but definitely the first impression was positive!

Just for comparison and history, I put together a chart showing the result obtained for the darkest adjustment of each luminosity plugin.
Image
or 1600x932 in https://i.imgur.com/RNlXkdQ.png

A gradual improvement is noticeable during the change in versions:
David1 - DAvid DM (more selective than the previous version, but not very comprehensive) - Equal (better perception of dark tones) - Dev Equal (better adjusted, with greater coverage).

But it is a somewhat superficial opinion, since I had little time and did not test the plugin as much as I would like.

Thanks for the improvements!
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston
0


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 27 guests