Differentiate between RGB and RGB Grayscale

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: Kukurykus, Tom, xbytor

Posts: 1
Joined: Sat Oct 16, 2021 12:32 am

Differentiate between RGB and RGB Grayscale

Post by lordtiesto »

Hello! I'm working with scanned pictures. Some of them are in color and some are old grayscale pictures. The scanner saved both as RGB.

I would like to know if there's any way to differentiate them in Photoshop to create an script
I tried using the mean of each color channel (thinking that when the picture is grayscale they would have all the same mean) but they're still slightly different

Just to complete the idea: ¿why do I need to differentiate them? Because I want to apply a preset if the picture is in color, and another preset when the pictures is in grayscale

Thank you!

User avatar
Posts: 433
Joined: Mon Jul 25, 2016 12:36 pm

Re: Differentiate between RGB and RGB Grayscale

Post by Kukurykus »

Maybe to help in understanding the problem post some screenshots to show how it looks now and what you want to achieve.

User avatar
Posts: 11
Joined: Sun Aug 04, 2019 12:37 pm

Re: Differentiate between RGB and RGB Grayscale

Post by Stephen_A_Marsh »

The colour RGB images would have very different channel content: R, G, B.

The greyscale RGB images would (should) have the same channel content: R = G = B.

Comparing the histogram content for each channel would be one possible solution, however it sounds like this is not a perfectly desaturated image.

Can you provide links to a handful of the images? There should be a more significant difference in the std. dev. value between full colour and "near" grey. Is there a common difference such as the std. dev. always being higher than the mean in the colour images? There must be some pattern that can be used to identify, which can then be used by a script to add metadata or run an action or specific processing etc.

Perhaps the eyes will win in this task – so use Adobe Bridge to sort/rank/label and then automation can be performed based on such metadata.