Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Which exact colors?
Are there Spot Colors involved?
Copy link to clipboard
Copied
Yes, it sometimes contains spot colors, but it's enough for me to check for CMYK as well. There is no unique combinations, it is necessary to compare only those colors that are printed at the same angle, but let's say that I have solved that part, but I still have this problem - how to compare the values of two channels in each pixel?
Copy link to clipboard
Copied
When you use Channels you can access their Histograms – an Array of 255 integers – via Script.
No overlap would mean the white value’s integer should be equal to the total number of pixels of the image and an if-clause can beused to check that.
Copy link to clipboard
Copied
I would recommend you try to work out a way using the Channels and the resulting Histogram – then you can automate that with with a Script.
The creation of a temp File or Channel for the operations and evaluation of the Histogram would probably be noticable (before it is closed or deleted), but depending on the images’ sizes it might not take long.
Copy link to clipboard
Copied
Wouldn't moiré only be a concern if more than 3 channels/plates were in play for the colour (presuming angles were correctly spaced for 2 and 3 colours)?
EDIT: You must have say 6 or more inks and there is a possibility that two inks may clash as you may have a good angle for one colour combination, but not another.
Copy link to clipboard
Copied
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:
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! 🙂
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Simply duplicating will not filter any values though, so it won't be any clearer whether there is an issue.
But but but! Duplicating IS faster than color range, so if you duplicate and do a threshold filter on the resulting channel, you can filter your values!
So yeah, duplicate cyan & black to a new channel, threshold at whatever value you desire (100% as per OP) then intersect them and check for a selection is probably fastest & most accurate!
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now