Solved

imagecopymerge png and jpg

Posted on 2010-08-18
2
445 Views
Last Modified: 2012-05-10
could imagecopy merge
combine a
jpeg on the bottom
and a transparent png on the top

what other code do i need than this

imagecopymerge($image,$watermark, $x_pos, $y_pos, 0, 0, $watermark_width, $watermark_height, 100);
0
Comment
Question by:rgb192
2 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 33470080

<?php // RAY_image_watermark.php
error_reporting(E_ALL);

// LOCATION OF THE IMAGES
$original = 'http://www.LAPRBass.com/RAY_add_watermark_source_image.jpg';
$h2o_mark = 'http://www.LAPRBass.com/RAY_add_watermark_watermark_image.png'; 

// MAN PAGE http://us3.php.net/manual/en/function.imagecreatefrompng.php
$im = ImageCreateFromJPEG($original);
$wm = ImageCreateFromPNG($h2o_mark);

// ADD WATERMARK
imagelogo($im, $wm, imagesx($im), imagesy($im), imagesx($wm), imagesy($wm));

// SHOW THE IMAGE
header('Content-type: image/jpg');
ImageJPEG($im);

// SEE http://us3.php.net/manual/en/function.imagealphablending.php#77085
function imagelogo (&$dst_image, $src_image, $dst_w, $dst_h, $src_w, $src_h) 
{
    ImageAlphaBlending($dst_image,TRUE);
    ImageAlphaBlending($src_image,TRUE);
    ImageCopy($dst_image, $src_image, ($dst_w-$src_w), ($dst_h-$src_h), 0, 0, $src_w, $src_h);
}

Open in new window

0
 

Author Closing Comment

by:rgb192
ID: 33582742
thanks
0

Featured Post

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now