Check image for any other pixel colors than black

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

Dariusz1989

Check image for any other pixel colors than black

Post by Dariusz1989 »

Heya

I remember seeing topic on this forum that explained on how to do it and I'm kicking myself for not saving it anywhere.

In any case I write my own "Load in to Stack" tool that I would like to fine tune. Mainly I want it to diagnose layers before copying it to my comp for any pixels in image that are other than black. I have many black images that are waste of space in my comp that I would like to automatically ignore.

I work with 10 000 x 8 000 pixels on average pictures if there are more than 1 ways to find out the pixel data and are slow on large images.

Does any1 know what is the command for it? I remember something that involved building histogram and based on result I could request to ignore layer from moving to my psd file.

Regards

Dariusz
pfaffenbichler

Check image for any other pixel colors than black

Post by pfaffenbichler »

You already mentioned the Histogram.
If the histograms 0-value is identical to the total number of pixels the image is black (though if you use the composite there may be some variation as 0/0/1 would for example still count).