Revision History | ||
---|---|---|
Revision $Revision: 1.0 $ | 2011-01-23 | r.s |
The Curve loader plugin loads the curve files written by the Curve Tool and returns arrays of values for use with gimp-curves-spline or gimp-curves-explicit.
You can get to this tool :
In Script-Fu with the command (plug-in-curveloader CHANNELS FILENAME).
Only one array and the element count of this array is returned, where 0 represents the value channel, 1 the red channel, 2 the green channel, 3 the blue channel and 4 the alpha channel. You can also use the predefined values HISTOGRAM-VALUE, HISTOGRAM-RED, HISTOGRAM-GREEN, HISTOGRAM-BLUE or HISTOGRAM-ALPHA.
Return all channels from the curve file as arrays. The first element is the element count of the value array, then the value array, then the element count of the red array, then the red array ...
The file name of the curve file to be loaded.
Return the green channel curve from file mycurve
Return the red channel curve from file redcurve
Apply all channel curves from file allcurves
Apply all channel curves from file allcurves, the short way
Download theexample scheme file and copy it to your scripts folder.
Old GIMP curve files, which look like this:
with 34 values per line (dots are for better overview only).
The lines represent the channels value, red, green, blue and alpha.
The values are paired in and out values of colors in the range between 0
and 255. Values of -1 are ignored.
New GIMP curve files, which look like this:
with 34 or 256 values per channel (dots are for better overview only).
If the curve-type is smooth the plugin will return the smooth curve, else the freeform
curve will be returned. The values are paired (smooth curve) in and out values of
colors in the range between 0.0 and 1.0, therefore multiplied by 255 in the output.
Again values of -1 (in the smooth curve) are ignored.
The file parsing routine does not check for the element count of exactly 34 points in
the smootth curve, so even curves with minimal 2 valid pairs of points will be accepted
(applies to both curve file types).