06-09-2018, 06:45 PM
(This post was last modified: 06-09-2018, 06:50 PM by trandoductin.)
I roughly translated a c plugin into a python script here:
http://www.gimplearn.net/viewtopic.php/G...815#p17815
The main logic is it loops through all the pixel coordinates.
- at each pixel coordinate.
- grab color value of red channel of bottom layer (r value) turns this into an index.
- add color value of red channel of top layer to color[index] (r[index])
- increment frequency (frequency[index], rf[index]) (like counting pixels)
- do this to green, and blue values as well.
That's it, it does this for all channels to create an RGB curve using the above calculated values.
I am wondering if pdb.gimp_histogram can be used so that script is faster than the current pixel by pixel calculation.
I tried thinking about histogram but I am not familiar with it and the location is involved as it calculates what color is actually in place of previous color so I am totally confused and not sure at all if histogram can some how perform this task.
http://www.gimplearn.net/viewtopic.php/G...815#p17815
The main logic is it loops through all the pixel coordinates.
- at each pixel coordinate.
- grab color value of red channel of bottom layer (r value) turns this into an index.
- add color value of red channel of top layer to color[index] (r[index])
- increment frequency (frequency[index], rf[index]) (like counting pixels)
- do this to green, and blue values as well.
That's it, it does this for all channels to create an RGB curve using the above calculated values.
I am wondering if pdb.gimp_histogram can be used so that script is faster than the current pixel by pixel calculation.
I tried thinking about histogram but I am not familiar with it and the location is involved as it calculates what color is actually in place of previous color so I am totally confused and not sure at all if histogram can some how perform this task.