Jump to content

Create PHP Image with other Images on it


MasterK

Recommended Posts

Hello,

 

I need pointed in the right direction, What I am trying to do is take an 468x100 image, and add 1-10 small images and specified names onto it, the image are hosted on my server. I would also like them to be saved as .PNG image files, with a specified name

 

Ugly looking example of what I want it to do

 

badexample.jpg

 

If there is anything else needed to point me in the right direction ask i'll try to explain  :P

Here some choice from the manual

imagecreatefromgif

imagecopymerge

imagettftext

imagepng

 

And here a basic sample

<?php
// Create image instances
$dest = imagecreatefrompng('background.png');
$src = imagecreatefrompng('sprite.png');

// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = 'arial.ttf';

//colour
$black = imagecolorallocate($dest, 0, 0, 0);

// Add the text
imagettftext($src, 20, 0, 10, 20, $black, $font, $text);

// Copy and merge
imagecopymerge($dest, $src, 10, 10, 0, 0, 100, 47, 75);


imagepng($dest,"newimage.png");
imagedestroy($dest);
imagedestroy($src);
?>

 

Hope that helps

GOTTA CATCH 'EM ALL, POKEMON!

Sorry. Theme song moment.

 

 

I have nothing to contribute, I just thought I'd throw some thumbs up. Sorry to intrude! :D

 

lmao, Nice.

 

 

and Ty, MadTechie, I am going to play with that code and those commands, hopefully I can get it  :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.