Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controlling Hue Chroma ?
#1
Hi,

I would like to modify the hue-chroma of some images.

I tried the following function:


Code:
(gimp-drawable-hue-chroma drawable MODE-REPLACE -60 20 0 100.0)

But it gives me an error:


Code:
Error: eval: unbound variable: gimp-drawable-hue-chroma

If someone knows which command to use and what are the parameters ?
Reply
#2
(11-14-2024, 07:45 AM)Alpha504 Wrote: Hi,

I would like to modify the hue-chroma of some images.

I tried the following function:


Code:
(gimp-drawable-hue-chroma drawable MODE-REPLACE -60 20 0 100.0)

But it gives me an error:


Code:
Error: eval: unbound variable: gimp-drawable-hue-chroma

If someone knows which command to use and what are the parameters ?
There is no PDB function that contains chroma in its name. The nearest function is gimp-drawable-hue-saturation.

If you use "Filters/Script-Fu/Console" and click the "Browse..." button you can search for PDB functions by typing part of the name in the "Search:" box - you will then see which functions are associated with the part of the name that you entered and what the function parameters are.
Reply
#3
(11-14-2024, 07:45 AM)Alpha504 Wrote: Hi,

I would like to modify the hue-chroma of some images.

I tried the following function:


Code:
(gimp-drawable-hue-chroma drawable MODE-REPLACE -60 20 0 100.0)

But it gives me an error:


Code:
Error: eval: unbound variable: gimp-drawable-hue-chroma

If someone knows which command to use and what are the parameters ?

As the gegl icon indicates, these filters are GEGL filters, and there is no easy way to call them in Gimp2.10 (some people did it, but it's not a pretty sight).

Things are somewhat easier (but not outright easy yet) in Gimp3+Python3. See this for instance.

Note that for such simple transforms, utilities such as ImageMagick or Python image libraries such as Pillow probably have the functionality.
Reply
#4
Thanks for replies, I looked at the source code of gimp 2.10, and I quickly wrote a modification, in order to get it working.

I took the source code of gimp-drawable-hue-saturation as a base, and used babl library to switch between RGB and HCL.

With the same parameters, my implementation gives an image that is very close to the one manually created with gimp user interface. But the two images are not identical. I have compared them with Imagemagick tool "compare".

However, the images given by my implementation seem to be usable.

I think I will have to compare with other software tools and libraries to know what is the best option.
Reply
#5
On some images there are some color artifacts when I use gimp user interface.

But with my modified implementation of gimp and a gimp script, the image looks better.

Here is one of  my experiments, I changed hue to -60 and chroma to +20.

The original image:
   

The image given by gimp user interface, we can see some color artifacts in the bottom of the image, but maybe it is correct this algorithm to make them:
   

The image given by the script with the modified implementation of gimp, without artifacts, but the color of the part under the folder have changed to gold instead of silver in the original image:
   

And the differences between the two last images:
   

I have attached the original file, if someone wants to make experiments with other software or maybe gimp 3.0.


Attached Files Image(s)
   
Reply


Forum Jump: