Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not really sure I have grasped the question, so this is a real punt.</p> <p>But I noticed LaC's answer depends on the pixels being written on top of each other in the normal way. In the manner you would in Photoshop call the "Normal Blend Mode".</p> <p>You can merge two layers in lots of other ways including "Multiply":</p> <p><img src="https://i.stack.imgur.com/MweNX.jpg" alt="enter image description here"></p> <p>This individually multiplies the R, G, and B of each pixel. So if you had the text on a white background, you could get a further-back layer to show through by setting the top layer to "Multiply" which causes both layers to burn into each other like so.</p> <p>This should work for your use case too:</p> <p><img src="https://i.stack.imgur.com/ofnuG.png" alt="enter image description here"></p> <p>Both text layers in this shot have an opaque white background, but the one on the right has the blend mode set to "<strong>Multiply</strong>".</p> <p>With "Multiply":</p> <ul> <li>white pixels in the top layer multiply lower layers by 1, leaving them unchanged</li> <li>black pixels in the top layer multiply lower layers by 0, reducing them to black</li> <li>shades in between darken the lower layers proportionally</li> </ul> <p>In other words, the same result that you would have got just laying the text directly onto the background.</p> <p>I haven't subpixel antialiased the text in this screenshot but it would work equally well with differing R, G, and B values.</p> <hr> <p>I'm not remotely familiar with Mac's API, but according to <a href="http://parmanoir.com/Photoshop-like_compositing_with_Core_Animation" rel="nofollow noreferrer">this link</a>, Core Animation does have this capability, which you get by writing:</p> <pre><code>myLayer.compositingFilter = [CIFilter filterWithName:@"CIMultiplyBlendMode"]; </code></pre> <p>or</p> <pre><code>myLayer.compositingFilter = [CIFilter filterWithName:@"CIMultiplyCompositing"]; </code></pre> <p>(I have no idea what "Blend Mode" vs "Compositing" relates to in Mac parlance so you'll have to try both!)</p> <hr> <p>EDIT: I'm not sure you ever specified your text was Black. If it's White, you can use a white-on-black layer set to a Blend Mode of "Screen".</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload