473,320 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Merge images / add logo

Hi there,
I was wondering what's the quickest way to put a (transp-PNG)
over a picture?

I have a code, but i guess it's sloppy. And it's slow.
(Code below this message)

Could anyone help me out on this?

Thanks

Greetings Frizzle.

*************************************
$img_id = substr( '0000000000'.$_GET['id'], -10, 10);

$info = getimagesize($img_id.".jpg");

$photo = imagecreatetruecolor($info[0], $info[1]);

$pic = imagecreatefromjpeg($img_id.".jpg");
imagecopy($photo, $pic, 0, 0, 0, 0, $info[0], $info[1]);

$logo = imagecreatefrompng("photo_logo.png");
imagecopy($photo, $logo, 20, 30, 0, 0, 128, 20);
header("Content-type: image/jpeg");
imagejpeg($photo , "", 90);
imagedestroy($photo);

*************************************

Jul 21 '05 #1
12 18841
I noticed that Message-ID:
<11**********************@f14g2000cwb.googlegroups .com> from frizzle
contained the following:

I was wondering what's the quickest way to put a (transp-PNG)
over a picture?


Funnily enough, I've been working on exactly this today. It's a first
hack so is probably messy and also a bit slow. Best to create the image
on upload then save it.

Image:
http://www.ckdog.co.uk/php/imgtests/me.jpg
Pattern:
http://www.ckdog.co.uk/php/imgtests/patternsq.jpg
Output:
http://www.ckdog.co.uk/php/imgtests/emboss.php
Code:
http://www.ckdog.co.uk/php/imgtests/emboss.phps

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 21 '05 #2
Dude,
that's a great script!
Too bad, this isn't what i intended to create.

I have my logo with colors & transparency as a PNG file,
all i want to do is put it on top of a photo.
The way i'm doing it now is slow, and i believe i'm making
a few steps to many ...
Again, compliments with your script!

Frizzle.

Jul 21 '05 #3
frizzle wrote:
I was wondering what's the quickest way to put a (transp-PNG)
over a picture?


Is this what you mean?
http://koivi.com/php-gd-image-watermark/

--
Justin Koivisto, ZCE - ju****@koivi.com
http://koivi.com
Jul 22 '05 #4
JDS
On Thu, 21 Jul 2005 23:39:32 +0100, Geoff Berrow wrote:
http://www.ckdog.co.uk/php/imgtests/me.jpg


I hope that's not *really* you

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 22 '05 #5
I noticed that Message-ID:
<pa****************************@example.invalid> from JDS contained the
following:
http://www.ckdog.co.uk/php/imgtests/me.jpg


I hope that's not *really* you

Sadly, it is.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 22 '05 #6
Hmm thanks for the effort Justin,
but all i need is to combine 2 images, no transparency
or whatever.
It's probably just a very simple script ...

Thanks anyway!

Greetings Frizzle.

Jul 22 '05 #7
* bump ? *

Jul 24 '05 #8
frizzle wrote:
* bump ? *


What?
Brian
Jul 24 '05 #9
SOR
<comp.lang.php , Default User , de***********@yahoo.com>
<3k************@individual.net>
<24 Jul 2005 00:06:36 GMT>
frizzle wrote:
* bump ? *


What?


Frizzle must think this is a web forum :-)
Jul 24 '05 #10
I wanted to give this message an extra boost, so it stays under the
attention, cause i'm really eager to know the solution ...

Jul 24 '05 #11
frizzle wrote:
I wanted to give this message an extra boost, so it stays under the
attention, cause i'm really eager to know the solution ...

I don't believe you are that familiar with how usenet and the majority
of newsreaders work. What you did is unlikely to achieve your goal.

A more typical approach would be to add information, especially
concerning things you've tried to solve it on your own, and the results
from those. You *have* been working on it, haven't you?


Brian
Jul 24 '05 #12
Yes of course i have!
I came here, because i really couldn't figure out the answer.
I pasted the script in my original post, so other people could
see what i have sofra.

I tried to change it etc. etc. but nothing seemed to work, i only
came up with a black image, the size of the picture with the logo
on it, but not what i wanted: only the JPG photo, with a transp-PNG
logo over it, PHP doesn't need to render any extra opacity or
whatever.

I've given as much as information as i have now ....
If there's anyone willing to help me, and needs some more info on
this, * please* ask me ...

I did not intend to abuse the usnetgroups or whatever...

Greetings Frizzle.

Jul 26 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Carl Gilbert | last post by:
Hi I want to write an application that can merge two images with a bit of re-sizing and changing of opacity thrown in for good measure. I have a backdrop that can be in any format and an...
0
by: Zeeway | last post by:
hi,everyone I have a question about merging images. I want to merge serval tiff images into one file using C#,that means the final file has multiple frames.My problem is that I want each frame in...
7
by: petr pilsl | last post by:
sorry - no idea where to post my question, so I crossposted to a linux and a html-authoring-group. Both groups might be familiar with wget. wget -p http://www.goldfisch.at does not load the...
76
by: rcoco | last post by:
Hi all, I'm facing this problem I have images on my website but when I Deploye the website on server the Images are not there I only get the X sign. How can I go about this. Thanks
0
by: etnaelk | last post by:
Hi all, I have a real bugger of a problem that I just haven't been able to figure out. I am working on writing my own proxy server in C# using TcpListener, TcpClient, HttpWebRequest/Response and...
2
by: lawpoop | last post by:
Hello all -- I'm having a problem getting images to appear in the body of an HTML email using PEAR's mail_mime class. Here's my code, what am I doing wrong? include("Mail.php");...
2
by: Simon Wigzell | last post by:
I have inherited a database driven website that comes with a table of image links. The images are scattered all of the internet and there are thousands of them. I would like to write an asp script...
4
by: tstrogen | last post by:
I am using Python 2.6 on Mac OS 10.3.9. I have been trying to use: image = urllib.URLopener() image.retrieve(url, filename) to download images from websites. I am able to do so, and end up with...
2
by: artlean | last post by:
I'm trying to create a page where users can just enter a url into a textbox, click search, and then we list all of the images on that exact page. So far I've managed to get it to scrape the entire...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.