Is it possible to get the image / mask from a layer, or the composed image from the document through the uxp api, either directly or using batchplay? Either as an javascript Image or an array.
If you’re talking about the pixel data, there’s a feature planned on the roadmap:
https://trello.com/c/DJk5qmPk
I think currently your best/only option is to export the document and read the file data.