Skip to content
Advertisement

Problem pasting one image into another PHP

I want to paste the $original image into the center of $fondo image, i write the following code:

JavaScript

The result i got is this:

enter image description here

As you can see the cyan color is affecting original image:

Any ideas on what i’m wrong? Thank you!

enter image description here

Advertisement

Answer

the solution is:

Creating the image as imagecreatetruecolor instead of imagecreate

JavaScript

Then, need to paint the $fondo with imagefill($fondo,0,0,$color_fondo);

Also, crop as circle using this function

JavaScript

The result is :

enter image description here

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement