I'm trying to discover a way of detecting transparent pixels. More over if an image is on a transparent background. Looking at the four corner pixels will be sufficient.
Only I don't think there's a way to detect RGBA as if the code below is run on a transparent pixels it throws an General Photoshop 8800 error. Any ideas? Apart from a try/catch and or trying to copy paste said pixels.
// Add a Color Sampler at a given x and y coordinate in the image.
var pointSample = app.activeDocument.colorSamplers.add([(x),(y)]);
// Obtain array of RGB values.
var rgb = [
pointSample.color.rgb.red,
pointSample.color.rgb.green,
pointSample.color.rgb.blue
];