06-11-2023, 06:41 PM
Hi,
This question came out of the following posts:
http://gimpchat.com/viewtopic.php?f=11&t...70#p280208
http://gimpchat.com/viewtopic.php?f=11&t...70#p280237
http://gimpchat.com/viewtopic.php?f=11&t...70#p280240
http://gimpchat.com/viewtopic.php?f=11&t...70#p280246
Does pdb.gimp_drawable_curves_spline want the spline control points to be in the range 0.0 - 1.0, or 0 - 255, or can it cope with either?
As far as I can make out, the deprecated pdb.gimp_curves_spline takes 0 - 255 and calls the C function curves_spline_invoker() that divides each point by 255. The replacement pdb.gimp_drawable_curves_spline calls drawable_curves_spline_invoker() that looks very similar but without the divide.
In summary these both work for me:
pdb.gimp_curves_spline(layer_copy, HISTOGRAM_VALUE, 6, [0, 0, 157, 110, 255, 255])
pdb.gimp_drawable_curves_spline(layer_copy, HISTOGRAM_VALUE, 6, [0.0, 0.0, 0.615, 0.431, 1.0, 1.0])
This doesn't work for me, as it makes the layer all black, but works for David and Issabella:
pdb.gimp_drawable_curves_spline(layer_copy, HISTOGRAM_VALUE, 6, [0, 0, 157, 110, 255, 255])
Should the latter work and why would it work for them and not me?
Many thanks for any help.
This question came out of the following posts:
http://gimpchat.com/viewtopic.php?f=11&t...70#p280208
http://gimpchat.com/viewtopic.php?f=11&t...70#p280237
http://gimpchat.com/viewtopic.php?f=11&t...70#p280240
http://gimpchat.com/viewtopic.php?f=11&t...70#p280246
Does pdb.gimp_drawable_curves_spline want the spline control points to be in the range 0.0 - 1.0, or 0 - 255, or can it cope with either?
As far as I can make out, the deprecated pdb.gimp_curves_spline takes 0 - 255 and calls the C function curves_spline_invoker() that divides each point by 255. The replacement pdb.gimp_drawable_curves_spline calls drawable_curves_spline_invoker() that looks very similar but without the divide.
In summary these both work for me:
pdb.gimp_curves_spline(layer_copy, HISTOGRAM_VALUE, 6, [0, 0, 157, 110, 255, 255])
pdb.gimp_drawable_curves_spline(layer_copy, HISTOGRAM_VALUE, 6, [0.0, 0.0, 0.615, 0.431, 1.0, 1.0])
This doesn't work for me, as it makes the layer all black, but works for David and Issabella:
pdb.gimp_drawable_curves_spline(layer_copy, HISTOGRAM_VALUE, 6, [0, 0, 157, 110, 255, 255])
Should the latter work and why would it work for them and not me?
Many thanks for any help.