I use imaging API often in my clients’ projects and it is super useful, especially when it comes to performance, but I really miss two things and I would love to make a request if possible:
1. Alpha for Grayscale/Lab reads. The docs list GrayscaleAlpha and LABAlpha as valid pixelFormat values, but getPixels never produces them - a colorSpace: "Grayscale" read always comes back 1-component with hasAlpha: false, even on a layer with transparency:
const px = await imaging.getPixels({
layerID: layer.id,
componentSize: 8,
applyAlpha: false,
colorSpace: "Grayscale",
});
// pixelFormat: "Grayscale", components: 1, hasAlpha: false (alpha dropped
)
The plain RGBA read on the same layer returns 4 components with alpha, so the data exists - it’s just lost in the grayscale conversion. Could a Grayscale read with applyAlpha: false return GrayscaleAlpha (2 comp) when transparency is present (and Lab LABAlpha)?
same issue was stated in this comment and this topic
2. CMYK / multichannel read. Seconding the earlier ask - direct getPixels access to CMYK and spot/multichannel data would be huge
Thank you!
Evgenii