Closed bebraw closed 12 years ago
For the curves() function, you have to specify 4 arguments: a start point, 1st control point, 2nd control point, and end point.
Not sure what you mean by "adjusting the value of the colors," could you elaborate a bit?
For the curves() function, you have to specify 4 arguments: a start point, 1st control point, 2nd control point, and end point. Not sure what you mean by "adjusting the value of the colors," could you elaborate a bit?
Basically I'm trying to port a color filter from a GIMP plugin.
The original code looks like this:
(gimp-curves-spline draw HISTOGRAM-VALUE 8 #(0 0 68 64 190 219 255 255))
(gimp-curves-spline draw HISTOGRAM-RED 8 #(0 0 39 93 193 147 255 255))
(gimp-curves-spline draw HISTOGRAM-GREEN 6 #(0 0 68 70 255 207))
(gimp-curves-spline draw HISTOGRAM-BLUE 6 #(0 0 94 94 255 199))
Apparently value maps to overall brightness. As you can see some of those channels have just three pairs of control points. Any idea how to work around these issues?
Thanks for the prompt feedback by the way. :)
Hmm... I may be wrong, but at first look I think the same effect can be achieved if the middle two control points have the same coordinate.
Caman("#image", function () {
this.curves('g', [0, 0], [68, 70], [68, 70], [255, 207]);
this.render();
});
This is something that can be built into the curves() function in the future by checking for the # of arguments.
Hmm... I may be wrong, but at first look I think the same effect can be achieved if the middle two control points have the same coordinate.
Oh, right. That's definitely true.
This is something that can be built into the curves() function in the future by checking for the # of arguments.
Cool. I'll write a patch for you that does that.
Any idea how to deal with that value bit? I can probably live without that, though.
Not too sure... I would need to either see examples of what it's doing or play around with it myself in GIMP.
Not too sure... I would need to either see examples of what it's doing or play around with it myself in GIMP.
Ok. No probs. If I figure that out, I'll contribute a patch.
Going to close this issue given we managed to sort the issue out. Now to get that patch underway. :)
Try following:
Note the uneven length of the curves. This seems to result in "Uncaught TypeError: Cannot read property '0' of undefined ".
Is there some nice way to adjust "value" of the colors using a curve?