Author Topic: Easy Zone Adjustment script update  (Read 15291 times)

rayadagio

  • Script Magican in Residence
  • Lives here ;-)
  • ***
  • Posts: 540
    • View Profile
    • galery
Easy Zone Adjustment script update
« on: December 04, 2008, 07:21:46 pm »
Here’s another update of the Easy Zone Adjustment script (http://forum.meetthegimp.org/index.php/topic,42.msg1446.html#msg1446). The lightness of the colours can be calculated in a more appropriate way than it was done in the former code. There I just added the values of the three colour channels. Now it is implemented the correct calculation of the colour values according the HSV-model. The change in code is minimal, the results are just slightly different, but the programmer feels significantly better ;-)

Regards,
Bert

Rolf

  • Administrator
  • Sr. Member
  • ***
  • Posts: 1805
    • View Profile
Re: Easy Zone Adjustment script update
« Reply #1 on: December 04, 2008, 09:31:05 pm »
This sounds great!

I still haven't tried this - too much stuff left lying around. But I put a link to this thread into the show notes of the Meaningful Black episode.

rayadagio

  • Script Magican in Residence
  • Lives here ;-)
  • ***
  • Posts: 540
    • View Profile
    • galery
Re: Easy Zone Adjustment script update
« Reply #2 on: December 04, 2008, 10:33:27 pm »
I forgot to attach a sample processed by the new script. Here's one ...

Thank you Rolf! (I'm really looking forward to all the left lying MTG-stuff :-))

monoceros84

  • Administrator
  • Sr. Member
  • ***
  • Posts: 1898
    • View Profile
Re: Easy Zone Adjustment script update
« Reply #3 on: December 04, 2008, 11:10:11 pm »
Hehe, that's almost in the direction of the OPT pictures: http://forum.meetthegimp.org/index.php/topic,114.0.html
Cheers,
Mathias

Visit this site about my photography, my experiences in Norway and my blog:
http://www.gedankenquirl.de (German language)

Alec_Burgess

  • Regular
  • **
  • Posts: 13
    • View Profile
Re: Easy Zone Adjustment script update
« Reply #4 on: December 05, 2008, 10:22:58 am »
Here’s another update of the Easy Zone Adjustment script (http://forum.meetthegimp.org/index.php/topic,42.msg1446.html#msg1446). The lightness of the colours can be calculated in a more appropriate way than it was done in the former code. There I just added the values of the three colour channels. Now it is implemented the correct calculation of the colour values according the HSV-model. The change in code is minimal, the results are just slightly different, but the programmer feels significantly better ;-)

Regards,
Bert
Just a suggestion ... not sure if its feasible or not :-)
Would it be possible to select the colors to be used as white+black using the (relatively) new sample points feature: http://docs.gimp.org/en/gimp-sample-point-dialog.html

I think it might be easier than creating dual select regions, also easier to tweak location of selected color locations (just click and drag the sample points). I "assume" that the sample-colors are available "somehow" in script-fu (?)

If easy you could:
 - use sample points if any exist and fallback to selection regions
 - or provide a checkbox : use sample points/selection regions.

Whether or not you can/choose to implement sample-points for color choice, it would (IMO) be "nice" to not remove the selections ... again to allow easier tweaking of the black/white base colors.

[Edit add: I had assumed that the values shown in the two sliders depended on the colors chosen in the two selection areas. This seems not to be the case ... they always show 19.8% and 236.4% for dark and light respectively. Do these sliders do anything? ]

[Edit add 2: I ran Filters-Reset All Filters and the two values changed to 15% and 247% but behavior seems unaffected]

[Edit add 3: I hadn't realized until now that an effective way to "tweak" the color points is the following:
 - Make initial selection - execute Easy-zone
 - Don't like it? - Undo - selections are restored.
 - Move both with ALT+click Drag (change one of the two with Ctl+drag to enclose then redo Shift+ drag
 - Hit Ctrl+F - it re-executes Easy-zone with the new selections.
Nonetheless - I think using the sample points might be interesting]
« Last Edit: December 05, 2008, 10:56:18 am by Alec_Burgess »
Regards ... Alec

monoceros84

  • Administrator
  • Sr. Member
  • ***
  • Posts: 1898
    • View Profile
Re: Easy Zone Adjustment script update
« Reply #5 on: December 05, 2008, 01:28:55 pm »
If easy you could:
 - use sample points if any exist and fallback to selection regions
 - or provide a checkbox : use sample points/selection regions.
That's how it was done in the original (older) script. Bert (ray adagio) changed it to use a selection instead. No idea about the reason but he thought about it. See http://forum.meetthegimp.org/index.php/topic,42.45.html for more details. But your idea of using the one or the other by option is nice...

[Edit add: I had assumed that the values shown in the two sliders depended on the colors chosen in the two selection areas. This seems not to be the case ... they always show 19.8% and 236.4% for dark and light respectively. Do these sliders do anything? ]

[Edit add 2: I ran Filters-Reset All Filters and the two values changed to 15% and 247% but behavior seems unaffected]
I have not tried this newest version up to now but I guess I can answer anyway. The sliders you see are to select the colour (resp. the value) that shall replace the colour in your selection. So if you have chosen (52,20,20) as the dark point this colour will be replaced by (15,15,15) as an example. That removes colour cast all over the image and adjusts the contrast.
For more information on how the Zone Adjustment works, read the thread liked above or watch the video in episode 56: http://meetthegimp.org/episode-056-meaningful-black-and-ironing-aprons/
« Last Edit: December 05, 2008, 02:36:38 pm by monoceros84 »
Cheers,
Mathias

Visit this site about my photography, my experiences in Norway and my blog:
http://www.gedankenquirl.de (German language)

rayadagio

  • Script Magican in Residence
  • Lives here ;-)
  • ***
  • Posts: 540
    • View Profile
    • galery
Re: Easy Zone Adjustment script update
« Reply #6 on: December 05, 2008, 02:30:45 pm »
Hi Alec :-)

It was my initial aim to do it exactly as Rolf did it in his show, using sample points to select the desired pixels. Having explored the web including the Gimp PDB and the Gimp browsers I had to give it up. There seems to be no way to access sample points directly by script. If somebody knows a possibility I would be happy to get a hint. To find an alternative I first tried the path-tool but this was too circuitous. Doing it by selections seemed to be the best compromise.
You are right, the values shown in the dialog do not depend on the made selections. The sliders determine the target grey values. 15/247 is the default (RGB 15, 15, 15 for dark parts and 247, 247, 247 for light parts). It isn’t explained satisfactorily in the script instructions. I will add this and change the sliders’ captions.
According the deletion of the selections my train of thought was either I like the result, then I don’t need the selections anymore or I don’t like it, so I will undo the changes and the selections automatically reappear – exactly as you found out to do.
Thank you for all your comments! :-)
« Last Edit: December 05, 2008, 02:54:16 pm by ray adagio »

rayadagio

  • Script Magican in Residence
  • Lives here ;-)
  • ***
  • Posts: 540
    • View Profile
    • galery
Re: Easy Zone Adjustment script update
« Reply #7 on: December 05, 2008, 02:45:23 pm »
Ups, Mathias, I had not refreshed my browser, so I didn't see that you already answered to Alec.
The reason for my decision to use selections was the intention to write an automatically working script without necessity of manually transfering the selected colour values to the script. I found no way to do this using sample points. But I still have to stress that I'm a beginner. Thank you for your reply! :-)
« Last Edit: December 05, 2008, 02:50:05 pm by ray adagio »

rayadagio

  • Script Magican in Residence
  • Lives here ;-)
  • ***
  • Posts: 540
    • View Profile
    • galery
Re: Easy Zone Adjustment script update
« Reply #8 on: December 05, 2008, 03:17:11 pm »
Another argument for using selections: The result is not based on single pixels but on the mean values of small (almost monochromatic) pixel regions. Therefore it is less susceptible to random effects of selecting one single pixel. And the script is easier to apply for people like me, losing progressively their fine motor skills ;-)

monoceros84

  • Administrator
  • Sr. Member
  • ***
  • Posts: 1898
    • View Profile
Re: Easy Zone Adjustment script update
« Reply #9 on: December 05, 2008, 06:53:24 pm »
Another argument for using selections: The result is not based on single pixels but on the mean values of small (almost monochromatic) pixel regions. Therefore it is less susceptible to random effects of selecting one single pixel. And the script is easier to apply for people like me, losing progressively their fine motor skills ;-)

That's also a big advantage I see. When picking colours it's almost always better to do some averaging.
Cheers,
Mathias

Visit this site about my photography, my experiences in Norway and my blog:
http://www.gedankenquirl.de (German language)

Magnade

  • Regular
  • **
  • Posts: 6
    • View Profile
Re: Easy Zone Adjustment script update
« Reply #10 on: January 01, 2009, 08:11:53 pm »
minor problem I encountered while using this script
if one has multiple layers it doesn't grab the one selected to work on
the old zone script works however

monoceros84

  • Administrator
  • Sr. Member
  • ***
  • Posts: 1898
    • View Profile
Re: Easy Zone Adjustment script update
« Reply #11 on: January 02, 2009, 09:37:22 am »
minor problem I encountered while using this script
if one has multiple layers it doesn't grab the one selected to work on
the old zone script works however

You're prob. right, I have not noticed that. Thanks for the feedback.
Anyway, I would suggest to correct the colours and exposure before you do anything else to get the best result.
Cheers,
Mathias

Visit this site about my photography, my experiences in Norway and my blog:
http://www.gedankenquirl.de (German language)

rayadagio

  • Script Magican in Residence
  • Lives here ;-)
  • ***
  • Posts: 540
    • View Profile
    • galery
Re: Easy Zone Adjustment script update
« Reply #12 on: January 02, 2009, 01:35:45 pm »
I will try to fix it within the next few days (currently I'm knocked out by influenza). Thank you for the hint!


Rolf

  • Administrator
  • Sr. Member
  • ***
  • Posts: 1805
    • View Profile
Re: Easy Zone Adjustment script update
« Reply #13 on: January 02, 2009, 01:38:54 pm »
Get well soon!


rayadagio

  • Script Magican in Residence
  • Lives here ;-)
  • ***
  • Posts: 540
    • View Profile
    • galery
Re: Easy Zone Adjustment script update
« Reply #14 on: January 02, 2009, 01:41:11 pm »
 :)