Posted by & filed under Coding.

For a project that I’m working on I needed a way to fade out an image before overlaying text on to it. Text I’ve done. That’s not an issue. But I haven’t ever done anything with PHP with fading out an image.

Turns out there’s a library called Jaguar that makes it, and other image manipulation, really easy for PHP.

The code below loads an image and covers it with a white overlay to fade it out.

I left out the part where the text is added, but Jaguar makes adding text pretty easy as well.

And if you’re interested, the final result is used on the featured image on a font website that I’m setting up.

Leave a Reply

Your email address will not be published. Required fields are marked *