Gradient across stroke, inside opacity mask is thresholded for half the width of the stroke
Applying a black-to-white gradient across a stroke inside an opacity mask results in a portion of the opacity mask not being applied, corresponding to half the width of the stroke, almost as if it is clipped by the stroke. If the path is subsequently outlined, which creates a mesh, the behavior is the same. If the object is a filled bezier curve, the behavior is normal with the shape masked as expected.
-
Chris Clark
commented
Hi Egor, this generally resolved the issue! Using your global swatch best practice. The only remaining oddity, which happens both in RGB and CMYK is that there is always some visibility of the background with two overlapping, linearly opposing gradients (black to white and white to black). RGB attached for simplicity. They should actually appear as uniform. Also the color at the 50% distance is not even a tint. The behavior is the same whether the mask is made from a rectangle or a stroke.
New idea from comment
This comment was upgraded into a new idea: Overlapping linearly opposing gradients (solid-to-transparent, of the same color) doesn’t produce a solid color -
Chris, open the 'opacity mask_CMYK' one...
Zoom into the corner in the center and hide the supplementary object. Do you see the gradient doesn’t end abruptly, but actually blends?So go into the mask, select the path with the gradient, select the black stop, open the Color panel, and change the rich black this has into pure CMYK 0-0-0-100. Instead of pushing all the four channels into super dense mask, use one only.
For me it makes it work as expected. Does it for you?You should not use rich black (converted from the RGB black) in CMYK docs that cautiously. Sure, when copying artwork from an RGB doc into a CMYK one, Ai won’t allow a simple way to convert one black into another and opacity masks are closed-off boxes (even Ai’s own commands have no control over these en masse). Recolor dialog won’t know about blacks inside, when stuff selected outside.. Global swatches for the rescue!
-
Chris Clark
commented
Example image. The behavior is even stranger if you shift the position of the white stop in the gradient slider. The black stop behaves correctly. In CMYK, the white stop thresholds the masking to a different position! I think that is the key to understanding the bug. Still perfect in RGB.
-
Chris Clark
commented
Illustrator 30.3. Behavior is the same in CPU or GPU. I have an Apple M3 Max (integrated GPU).
-
Chris Clark
commented
Hi Egor, it seems to occur only in CMYK documents, not RGB documents, even if RGB colors for black and white are explicitly selected in the opacity mask.
-
Interesting. I use strokes across path in opacity mask in every third project (I mean it), but I never had a clipping like this.
Chris, can you please share this test file? I try to make it happen and it works OK.
Are you on 30.3? Same in Beta? Same in both RGB and CMYK docs? Same on CPU Preview? (what is your GPU?)