Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Batch Color Saturation
#1
How do I do batch Color Saturation?  I don't see an option in the Batch Manipulation menu and I don't want to use Hue Saturation.
Reply
#2
(08-10-2021, 04:55 PM)firefly Wrote: How do I do batch Color Saturation?  I don't see an option in the Batch Manipulation menu and I don't want to use Hue Saturation.

Is this using BIMP the batch plugin ?  If it is you can not use theColor -> Saturation filter directly. It is GEGL and not selectable as a "Other Gimp Operation" in BIMP.

You can 'wrap' the GEGL command in a python script which BIMP recognizes. If you are willing to do a little editing, a basic python plugin is attached.
First find the Saturation value you need from using Gimp on a typical image. That is the Scale value.  Get a decent text editor (not notepad or wordpad)  Usually Notepad++ and replace the value scale=10 in the script at line 52 eg. scale=0 is total desaturation. scale=2.5 is well across the GUI slider.
[code]
- - - - - -
def for_gegl_command(image, drawable):
# put your GEGL command here
# saturation scale minimum value 0  max value 10
    gegl_graph_string="saturation scale=10 colorspace=0"
- - - - - -
[code]

Unzip the attachment. For windows the plugin goes in C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\plug-ins  
The plugin registers in the Tools menu and you can try it out on an image.

In BIMP it is a "Other Gimp Procedure"

I normally use linux but tried out in a Win10 / Gimp 2.10.24 and it works with a few flashing on / off terminals as BIMP calls the plugin.

Not making separate screenshots for this one see:   https://i.imgur.com/Gta0EUX.jpg  Top the images used. Middle - the BIMP function Bottom - BIMP working, between first and second image. Not going to break any speed records but does get there.
EDIT: Thats it for today, bye


Attached Files
.zip   gegl-command.zip (Size: 1.09 KB / Downloads: 178)
Reply
#3
(08-10-2021, 07:54 PM)rich2005 Wrote:
(08-10-2021, 04:55 PM)firefly Wrote: How do I do batch Color Saturation?  I don't see an option in the Batch Manipulation menu and I don't want to use Hue Saturation.

Is this using BIMP the batch plugin ?  If it is you can not use theColor -> Saturation filter directly. It is GEGL and not selectable as a "Other Gimp Operation" in BIMP.

You can 'wrap' the GEGL command in a python script which BIMP recognizes. If you are willing to do a little editing, a basic python plugin is attached.
First find the Saturation value you need from using Gimp on a typical image. That is the Scale value.  Get a decent text editor (not notepad or wordpad)  Usually Notepad++ and replace the value scale=10 in the script at line 52 eg. scale=0 is total desaturation.  scale=2.5 is well across the GUI slider.
[code]
- - - - - -
def for_gegl_command(image, drawable):
# put your GEGL command here
# saturation scale minimum value 0  max value 10
    gegl_graph_string="saturation scale=10 colorspace=0"
- - - - - -
[code]

Unzip the attachment. For windows the plugin goes in C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\plug-ins  
The plugin registers in the Tools menu and you can try it out on an image.

In BIMP it is a "Other Gimp Procedure"

I normally use linux but tried out in a Win10 / Gimp 2.10.24 and it works with a few flashing on / off terminals as BIMP calls the plugin.

Not making separate screenshots for this one see:   https://i.imgur.com/Gta0EUX.jpg  Top the images used. Middle - the BIMP function Bottom - BIMP working, between first and second image. Not going to break any speed records but does get there.
EDIT: Thats it for today, bye

I really appreciate the information you sent.  I went as far as installing Notepad ++ and viewed the attached file hoping I might be able to figure it out.  I am totally a beginner when it comes to scripting so even with your guidance I couldn't figure out what the syntax should look like in the .py file.  

I don't suppose you would go so far as to give me a section of code that I could insert that would give me Color > Saturation = 1200?

Or if there is an easier way, like doing a batch command that would utilize the saturation level of an existing file?
Reply
#4
Do you have the plugin BIMP for GIMP?
If so, File > Batch image Manipulation...

1 then select "Other GIMP Procedure", then 2 to search
then click 3 then 4, it seems to be a bug, you can't access 4 if you don't hit 3 before
Play with the saturation

   

Now as wonderful as is this plugin, if you have 50, one hundred or more images I would recommend to not use GIMP, but XnConvert which is a software dedicated for super massive batch processing photos way faster, especially if it's just about simple operation like saturation.
Reply
#5
@ firefly

New day, modified plugin with 1.2 as the GEGL Saturation value. There is no 1200, the scale goes from 0.0  to 10.0

Included in the zip is a simple text editor if (when) you need to modify the scale value. It is not difficult.

This a video demo, from unpacking the zip through to applying BIMP.  https://youtu.be/JNlbuYJlHEQ





Quote:Or if there is an easier way, like doing a batch command that would utilize the saturation level of an existing file.
I do not think so, there is a way with the g'mic plugin of comparing a before / after pair, extracting a color-look-up-table (CLUT) and applying that to other images. Not sure you can apply that particular gmic filter with BIMP.
Another way is, adjust an image with the color-curve tool and save the curve settings as a file. BIMP will apply that color-curve using the file.

@PixLab
nice screenshots, pays to read the first post as the OP specifically does not want to use hue-saturation.


Attached Files
.zip   gegl-command-sat.zip (Size: 768.42 KB / Downloads: 186)
Reply
#6
(08-11-2021, 08:40 AM)rich2005 Wrote: @PixLab
nice screenshots, pays to read the first post as the OP specifically does not want to use hue-saturation.

Yeah, and I wonder why, does the "saturation" in "hue saturation" is different from other saturation?
Reply
#7
(08-11-2021, 12:07 PM)PixLab Wrote: Yeah, and I wonder why, does the "saturation" in "hue saturation" is different from other saturation?

I honestly do not know, opened a standard 'Lena' image, and I could not get exactly the same with hue-saturation, color-curves or with alternative g'mic filters. I guess it is all in the eye of the beholder. The python plugin is just my boilerplate file for use with BIMP the GEGL Saturate is simple as far as parameters go. Some of the others more complicated. I find it easier to get the GEGL working in Gimp then apply to the batch-images, or not use GEGL at-all Wink
Reply
#8
(08-11-2021, 12:19 PM)rich2005 Wrote: I honestly do not know, opened a standard 'Lena' image, and I could not get exactly the same with hue-saturation, color-curves or with alternative g'mic filters. I guess it is all in the eye of the beholder.  The python plugin is just my boilerplate file for use with BIMP the GEGL Saturate is simple as far as parameters go. Some of the others more complicated. I find it easier to get the GEGL working in Gimp then apply to the batch-images, or not use GEGL at-all Wink

Um... um... interesting!
I did try colors > hue saturation, colors > saturation, and colors > hue chroma, and strangely, and like you I was not able to get the same saturation, "hue saturation" seems to be very closed to "hue chroma", even though hue-saturation seems to have a bit more "light", but colors > saturation..., is in a different league (if I can say that), all that moving only the saturation slider.
Interesting and learning every day (and quite surprised as well kind of confused Confused ).
Thanks a lot Rich for your input.
Reply
#9
(08-11-2021, 12:07 PM)PixLab Wrote:
(08-11-2021, 08:40 AM)rich2005 Wrote: @PixLab
nice screenshots, pays to read the first post as the OP specifically does not want to use hue-saturation.

Yeah, and I wonder why, does the "saturation" in "hue saturation" is different from other saturation?

from what I have read it is better to use saturation, i think it is different.

(08-11-2021, 08:40 AM)rich2005 Wrote: @ firefly

New day, modified plugin with 1.2 as the GEGL Saturation value. There is no 1200, the scale goes from 0.0  to 10.0

Included in the zip is a simple text editor if (when) you need to modify the scale value. It is not difficult.

This a video demo, from unpacking the zip through to applying BIMP.  https://youtu.be/JNlbuYJlHEQ





Quote:Or if there is an easier way, like doing a batch command that would utilize the saturation level of an existing file.
I do not think so, there is a way with the g'mic plugin of comparing a before / after pair, extracting a color-look-up-table (CLUT) and applying that to other images. Not sure you can apply that particular gmic filter with BIMP.
Another way is, adjust an image with the color-curve tool and save the curve settings as a file. BIMP will apply that color-curve using the file.

@PixLab
nice screenshots, pays to read the first post as the OP specifically does not want to use hue-saturation.

Thanks for the file, I thought I had to do more editing than that, pretty simple.  Now, when I put the file in C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\plug-ins it doesn't show up in the Tool menu or the Batch Image Manipulation menu.  Is there another step to make it show up?  Do I need to reboot (Windows 10)?
Reply
#10
Quote:... Now, when I put the file in C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\plug-ins it doesn't show up in the Tool menu or the Batch Image Manipulation menu.  Is there another step to make it show up?  Do I need to reboot (Windows 10)?

No other steps, except re-starting Gimp. Works as shown in the video.

Edit: Checked again in Windows and can not find problem.
You did unzip it ? When editing careful not to introduce any spaces scale=0.5 is correct scale = 0.5 is not
Reply


Forum Jump: