2

I'm trying to create a produkt configurator similar to: http://winmap.active-online.de/kler/pol/index.php3?room_name=200D I'd like to put texture or color on diffrent image elements and put it together into one result image.

I'm trying to usa like this:

  header('Content-Type: image/jpeg');

$poszycie = imagecreatefrompng('poszycie.png');
$tekstura = imagecreatefrompng('tekstura.png'); 
//imagefilter($poszycie,IMG_FILTER_EMBOSS);
//imagepng($tekstura);

//$bcg = imagecreatefromjpeg('las.jpg');
//$img = imagecreatefromjpeg('zdjecie.jpg');

//imagecopymerge($poszycie, $tekstura, 0, 0, 0, 0, imagesx($poszycie), imagesy($poszycie), 75);
//imagepng($poszycie, null, 100);

imagecopymerge($poszycie, $tekstura, 0, 0, 0, 0, imagesx($poszycie), imagesy($poszycie), 50);

imagepng($poszycie);

but result is :http://saveur.pl/testgd/configurator.png

Thanks for any help.

eidsza
  • 21
  • 3

2 Answers2

1

I think you'll be better off with ImageMagick. For example you could use these tricks http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=14513&start=15 and I'm sure a web search for imagemagick texture image area would reveal more ideas.

Anyway you'll have to take apart the image and use the alpha channel.

Flavius
  • 13,566
  • 13
  • 80
  • 126
1

I think my answer to this question can help. The problem deals with alpha channel. Besides, you should send this header (png instead of jpeg):

header('Content-Type: image/png');

since you are calling

imagepng($poszycie);

which may be another cause of trouble.

Community
  • 1
  • 1
Paolo Stefan
  • 10,112
  • 5
  • 45
  • 64