-1

So i have a script that is printing text to an image using imagecreatefrompng function and a lot more but that is not the point. How could i print an image on the created image? I can print text to it but image not.

rsz
  • 1,141
  • 1
  • 18
  • 38
  • 2
    http://php.net/manual/en/function.imagecopyresampled.php – Pekka Jul 29 '12 at 07:43
  • That is okay but i would parse that image url from the curl script which is parsing the source code of an another site where the avatar url is and i would print it to the newly created image that is the function to do it yes? – rsz Jul 29 '12 at 07:47
  • @AnkitGautam i am using imagecreatefrompng which is loading an image then the function imagettftext is printing the text to this image and now i would to know how could i print an image like this to that image that i am printing text on. – rsz Jul 29 '12 at 07:51
  • @Ankit ImageMagick is a good choice and very flexible... on the other hand, it's not available on every server. – Pekka Jul 29 '12 at 07:54

1 Answers1

0

I don't know what you're doing, but may be better to do this client-side rather than with PHP.

There's ImageMagick for PHP that you can check out here http://www.imagemagick.org

PHP's native functions do not offer much in the way of this -- but do check out http://us.php.net/manual/en/function.imagecopymerge.php if you're not sold with either creating multiple layers with alpha channels in PS and then having php select them, or just client JS or something.

antman
  • 227
  • 2
  • 17
  • I have found a good example here: [link](http://www.lateralcode.com/manipulating-images-using-the-php-gd-library/) – rsz Jul 29 '12 at 08:17
  • I totally spaced on this despite just learning about it a few days ago -- I would +1 this if I could :) ... still think OP should consider these operations on the client if at all possible. – antman Jul 31 '12 at 02:28