Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A curiosity
#2
The problem is simple : you initialize the channelNum variable inside the loop (by doing channelNum=(0)).
So, at each iteration of the loop, the channelNum variable is set to (0).
Simply move the initialization of the variable before the loop :


Code:
# integer index of channelName
channelNum = (0)

for spline in splinePoints:
        layer_copy1 = pdb.gimp_layer_new_from_drawable(layer_copy, image)
        pdb.gimp_image_insert_layer(image, layer_copy1, None, 0)
        pdb.gimp_drawable_curves_spline(layer_copy1, HISTOGRAM_VALUE, len(spline), spline)
        channelName = str(channelNum)      

        # copy Red channel as:
        channelName = pdb.gimp_channel_new_from_component(image, CHANNEL_RED, channelName)
        pdb.gimp_image_insert_channel(image, channelName, None, 0)
       
        # increment integer index
        channelNum += 1                                   
       
        # remove equalized layer that was used to create masks
        pdb.gimp_image_remove_layer(image, layer_copy1)
Reply


Messages In This Thread
A curiosity - by david - 09-12-2020, 02:18 PM
RE: A curiosity - by tmanni - 09-12-2020, 06:26 PM
RE: A curiosity - by david - 09-12-2020, 08:11 PM

Forum Jump: