Heya,
I need to copy paste my selection into another document, but I’m trying to not use the clipboard.
So I found the imaging API, using getSelection I could “copy” the image data.
Using putPixels I could then insert the selection back into a layer, I thought.
But I keep having an error:
“the target colourspace does not match the source data. A colour profile must be specified for the source data.”, so I tried setting the colour profile for the source (the ImageData received by getSelection), but that was readOnly, so didn’t work.
I thought, maybe use getPixels, but that wouldn’t make much sense in my eyes since I’d have to get the sourceBounds using getSelection then.
Another way could be to duplicate the selection into another document, I couldn’t get this working as Layer#duplicate duplicates the whole layer, and I couldn’t find something to remove an selection (I could selection invert → delete then)
I’m probably overthinking this or missing something, help is greatly appreciated!