dinasset wrote:
It's not a problem of the image, it's due to the fact that in my procedure (it's an ongoing script I am writing) I do the following:
- open an image
- duplicate it
- create a square small selection
- duplicate the base layer
- from the selection create a palette using a filter (plug-in-smooth-palette) which create a new image (visible or not, user choice)
- then from that palette-image create a gradient
- overlay the selection with that gradient
at this point, during the development, I tried to perform the next steps interactively:
- select none
- create a new empty layer on the duplicated image
- select all
- select border 1 pixel
- run your script
because I tought that the default map selected was correct (the palette-layer was selected and visually it looks as the overlayed square layer of the duplicated image) I tried to run your script accepting the default!
once detected my error I modified the selection of the map (using the correct overlayed square layer of the image in process) adn the script worked fine.
Thus, if you want to investigate the missing check in your script, I guess you should control whether the wrong selection of an EXTERNAL layer-map (i.e. something NOT related to the image in process) could be checked and get a warning message.
It could work with a layer in another image (IIRC I designed it that way). What I don't understand is that the code retrieves the pixel color (which is a tuple or 1 to 4 elements, one for each channel, depending in the layer/image type), extracts/recreates the necessary R,G,B,A channels, and then divides them by 255. And the error is the division complaining that the dividend isn't a number but a tuple, and I can't image how the code could get a tuple there since that would mean that some elements of the color tuple are tuples themselves.