To combine two transparent png picture using php to get the stuff?

Hi all.
Guys need to put two transparent images on top of each other using php.
There is a solution, but not completely.
Use imagecopymerge
But the photos do not overlap.
Either get one photo. Either it turns out with a black background, tell me what to do?

Two png pictures ready imagecreatefrompng
What can I fix it?
July 2nd 19 at 14:47
2 answers
July 2nd 19 at 14:49
Maybe better using a sprite?
https://habrahabr.ru/post/159027/
I need this photo then save and process further! - Kamron29 commented on July 2nd 19 at 14:52
July 2nd 19 at 14:51
probably due to the fact that you initially create a photo without a transparent background
That is, explain please! - Kamron29 commented on July 2nd 19 at 14:54

Find more questions by tags PhotosPHP