Skip to main content
Inspiring
January 9, 2023
Question

How to parse colours of each pixel and compare

  • January 9, 2023
  • 3 replies
  • 870 views

I work with some CMYK tiff files, and i need to check is there pixels which are made with mix of two specified colors, for example CYAN and BLACK and alert user if that its true or not. Is it possible (and how) to check that with javascrpt or anyhow to parse colors of each pixel and compare them?

Thanks in advance

This topic has been closed for replies.

3 replies

davescm
Community Expert
Community Expert
January 9, 2023

Add a color fill layer and make it bright red for example (anything that will show up strongly)

Right click that layer and choose Blending options

Go to Blend if

Set the underlying layer blend if values to the combination of channel values that you want to be highlighted

 

Dave

Inspiring
January 9, 2023

I'm by no means an expert on print, but it sounds like you're talking about colors going out of gamut.

In this case, you could tackle this with a color range action.

 

Make 3 new actions, "Gamut Check", "isProblem", "isGood"

 

for the "gamut check" action:

  1. Record a color range step where you select "out of gamut" as the target (bottom of the list)

2. add a conditional step (on the action panel, go to the menu, select "add conditional step")

3. set this step to "document has a selection", then play action to "isProblem", and Else Play Action to "isGood"

4. stop recording gamut check

 

for the isProblem action:

1. add a Stop (on the action panel, go to the menu, select "add Stop...")

2. write whatever message you want to inform your user

3. stop recording isProblem

 

for isGood:

1. do what you want to do in case there is no problem. Can be nothing, can be something, up to you.

 

To use it:

The user can now play the "Gamut Check" action and will be informed if there are problems.

You can also link this action to an event in the Events manager so it is played every single time a document is opened and the user will not have to do anything. (But will be bothered every single time a document is opened)

 

All the best & good luck! 🙂

Inspiring
January 9, 2023

Another option....

 

Do a color range on your cyan channel with 0 fuziness at max value, store it to an alpha channel

Do a color range on your black channel with 0 fuziness at max value, store it to another alpha channel

Select one and intersect it with the other.

 

If you have a selection: you have the condition you described and can alert as per my previous post (conditional "has selection" bla bla bla)

c.pfaffenbichler
Community Expert
Community Expert
January 9, 2023

Do a color range on your cyan channel with 0 fuziness at max value, store it to an alpha channel

Or simply duplicate the Channel. 

c.pfaffenbichler
Community Expert
Community Expert
January 9, 2023

Checking each pixel individually is usually not plausible (at least for images of any significant size), but I expect it should possible to utilize a workaround that ultimately uses the histogram to determine the overlap. 

 

What’s the point of the task?  

milevicAuthor
Inspiring
January 9, 2023

I am working with some files that will be printed on flexo maschine, my needs are to check if there is mixing of certain colors to avoid the possibility of Moire effect 

c.pfaffenbichler
Community Expert
Community Expert
January 9, 2023

Which exact colors? 

Are there Spot Colors involved?