How to merge transparent PNG with image using PHP?

Spread the love

Question Description

The situation is this: I have a small 50×50 pic. I also have a small 50×50 transparent picture which contains a frame for the 50×50 pic, so I basically want to put the transparent png on top of the image and merge those two which would lead to a final third picture that looks something like this:

Note: I don’t want to do this using HTML only (I achieved this by writing a javascript plugin that put the transparent png on top of the original image).


Practice As Follows

You can merge the two images together using the PHP GD2 library.


You may be interested in these books.

(paid link)

As an Amazon Associate I earn from qualifying purchases.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.