Core Image processing for a photo overlaid text effect

The iPhone Lock Screen lets you display a small time and date at the top of the display that has a neat image processing effect where the text takes on the underlying colors with a blurred gradient while still maintaining legibility appearing largely white.

In this screenshot you can see the white text features blue colors at the top left and transitions to a purple color on the right due to the underlying vibrant blue and purple blocks.

Can you share how this text effect is achieved using Core Image?

Answered by Engineer in 893469022

You can do this using the the CITextImageGenerator to generate the text image. Then use CIColorMatrix to make the text semi-transparent white. For example after the color matrix should be RGBA = (0.9,0.9,0.9,0.9)

You can do this using the the CITextImageGenerator to generate the text image. Then use CIColorMatrix to make the text semi-transparent white. For example after the color matrix should be RGBA = (0.9,0.9,0.9,0.9)

Core Image processing for a photo overlaid text effect
 
 
Q