[Gambas-user] Color Range

Benoit Minisini benoit.minisini at gambas-basic.org
Wed Jul 26 11:01:32 CEST 2023

Le 26/07/2023 à 10:53, Claus Dietrich a écrit :
> Am 25.07.23 um 21:33 schrieb Benoit Minisini:
>> If you know the algorithm associated with the the image filter you 
>> need, you can try to implement it by accessing the image RGBA data 
>> directly, and use the FAST keyword to let the gcc compiler transform 
>> your Gambas code into a faster version.
>> As I understand the dialog box, you need to be able to define a 
>> function that takes a color intensity between 0 and 255 and that 
>> returns the new value, and apply that functino to a color channel.
>> Please confirm my interpretation!
>> Regards,
>> -- 
>> Benoît Minisini.
> Hi Benoit
> This sounds correct but image processing is not my domain. All I found 
> is an automatic algorithm written for Gimp in the language "LUA" 
> (Chapter 7.1 Contrast Stretching). The before/after comparison shows 
> what it can do:
> https://pippin.gimp.org/image-processing/chapter-automaticadjustments.html
> It might well be that this particular LUA algorithm is actually doing 
> what the Gambas "Equalize" function provides. As this provides rather 
> unpredictable results, it might already help if the min/max values were 
> adjustable (as option) and not being determined automatically. However, 
> programs like Gimp and good scanner programs also care about the medium 
> shades.
> The basics of "color curves" (my second requirement) are described here: 
> https://www.gimp.org/tutorials/Basic_Color_Curves/
> What would be the right approach to realize a color shade mapping for 
> red, green and blue individually with (FAST) Gambas?
> Regards
> Claus

I don't understand: do you want -automatic- or -manual- processing?

If you want manual processing, I can add a function that applies a 
"curve" to the image components (red, green, blue, alpha, value...) but 
I won't make a GUI for defining the curve like the GIMP has. It's up to you.


Benoît Minisini.

More information about the User mailing list