Skip to main content
_wckdTall_
Inspiring
April 22, 2023
Question

Detect different black tones Math advice - Illustrator

  • April 22, 2023
  • 2 replies
  • 3632 views

I'm working on replacing some irregular black tones in a document and I'm curious if anyone has math advice on this. It seems #000000 reads as c:75 m:68 y:67 k:90 and has a brightness of 0%. 100% K is R:35 G:31 B:32 and has a brightness of 13%, however there doesn't seem to be way to get brightness info anyway. I'm thinking there are 2 methods to judge what I want to be perceived as black.

 

1: CMYK approach
Check if K is greater than 85%

Check if C M Y are greater than 66%

I checked vs Pantone Blacks(though not arguably gray at best), and most are above these ranges, seems a higher Cyan value is also helpful here not to stay in gray territory.

2: RGB approach
Check if R G B are lower than 35
Determine if they're within 10 points of eachother

This arguably entering gray territory, 35 is the highest value we get with 100% K, and pushing any values away further away from eachother starts to become a color.

Is there simpler logic than this?

This topic has been closed for replies.

2 replies

m1b
Community Expert
Community Expert
June 17, 2023

Hi @_wckdTall_, did you get this working in your case? I'm happy to fix any bugs you find. - Mark

m1b
Community Expert
Community Expert
April 22, 2023

Hi @_wckdTall_, Hmm. Sorry if you know all this, but I need to start here before we can get going. 🙂

 

A useful way to approach color is by stating your goal at the outset. What is the color for? If it is for printing pigment, then CMYK or PANTONE etc are appropriate. If it is for screen, or light projection, then RGB is appropriate. And that is before we worry about the characteristics and capabilities of the coloring device, whether printer or monitor or projector, etc.

 

Mixing color spaces in the same document probably isn't wise, but it is common to mix color spaces at different stages of a job, eg. retouching in RGB, and exporting as CMYK (but keeping the RGB as master).

 

So, in your case, is your basic color space clear now? If not, you will probably want to use RGB and not mess around with CMYK until you need to print with pigments.

 

With that out of the way, it sounds like you are writing a script that aims to "snap" black-like colors to "actual" black. If so, does it need to work with CMYK colors or RGB colors? Or is it a general script? Also, you must decide what "actual" black is for your purpose. #000000 is as black as you can get in RGB, but won't be appropriate for many purposes (for example, it might be too dark for video).

- Mark

_wckdTall_
Inspiring
April 22, 2023

Color mode is a good point, but not something I can control, if I could I'd just start with the black tone I want. I basically received a bunch of BW AI files created by various users with different color spaces, and assets from different documents. Depending on how they've been created some will color with 100% K C:0 M:0 Y: 0 K:100, #000000 or just dragging the color to black in the color picker. Likely it's using Registration, in CMYK it's 100 100 100 100, but converted to RGB mode it's 75 68 67 90 or default Black in a new file CMYK 0 0 0 100 where in RGB mode it's 70 67 64 74. What does appear to stay the same in these cases are the RGB values across color modes.

In essence, I'm trying to script what Edit Colors does when it determines black, but I don't need it to be that sophisticated, just to assume black vs color when I trigger the script. 

m1b
Community Expert
Community Expert
April 22, 2023

Thanks @_wckdTall_, I'm gettting the picture. So what "black" do you want the script to change them to? I'm asking, because if it is a CMYK black, then the document's color mode needs to be changed to CMYK first I think. Or do you imagine having a CMYK black for CMYK documents and an RGB black for RGB?

- Mark