Connecting Tech Pros Worldwide Help | Site Map

Merge images / add logo

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 21st, 2005, 09:35 PM
frizzle
Guest
 
Posts: n/a
Default 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);



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


  #2  
Old July 21st, 2005, 11:05 PM
Geoff Berrow
Guest
 
Posts: n/a
Default Re: Merge images / add logo

I noticed that Message-ID:
<1121981492.298088.152490@f14g2000cwb.googlegroups .com> from frizzle
contained the following:
[color=blue]
>
>I was wondering what's the quickest way to put a (transp-PNG)
>over a picture?[/color]

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/
  #3  
Old July 21st, 2005, 11:05 PM
frizzle
Guest
 
Posts: n/a
Default Re: Merge images / add logo

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.

  #4  
Old July 22nd, 2005, 01:35 PM
Justin Koivisto
Guest
 
Posts: n/a
Default Re: Merge images / add logo

frizzle wrote:[color=blue]
> I was wondering what's the quickest way to put a (transp-PNG)
> over a picture?[/color]

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

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
  #5  
Old July 22nd, 2005, 02:05 PM
JDS
Guest
 
Posts: n/a
Default Re: Merge images / add logo

On Thu, 21 Jul 2005 23:39:32 +0100, Geoff Berrow wrote:
[color=blue]
> http://www.ckdog.co.uk/php/imgtests/me.jpg[/color]

I hope that's not *really* you

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

  #6  
Old July 22nd, 2005, 02:45 PM
Geoff Berrow
Guest
 
Posts: n/a
Default Re: Merge images / add logo

I noticed that Message-ID:
<pan.2005.07.22.13.37.54.852407@example.invalid> from JDS contained the
following:
[color=blue][color=green]
>> http://www.ckdog.co.uk/php/imgtests/me.jpg[/color]
>
>I hope that's not *really* you[/color]


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/
  #7  
Old July 22nd, 2005, 03:15 PM
frizzle
Guest
 
Posts: n/a
Default Re: Merge images / add logo

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.

  #8  
Old July 24th, 2005, 12:05 AM
frizzle
Guest
 
Posts: n/a
Default Re: Merge images / add logo

* bump ? *

  #9  
Old July 24th, 2005, 12:35 AM
Default User
Guest
 
Posts: n/a
Default Re: Merge images / add logo

frizzle wrote:
[color=blue]
> * bump ? *[/color]

What?


Brian
  #10  
Old July 24th, 2005, 12:55 AM
SOR
Guest
 
Posts: n/a
Default Re: Merge images / add logo

<comp.lang.php , Default User , defaultuserbr@yahoo.com>
<3kg4ccFtrdasU2@individual.net>
<24 Jul 2005 00:06:36 GMT>
[color=blue]
> frizzle wrote:
>[color=green]
> > * bump ? *[/color]
>
> What?
>[/color]

Frizzle must think this is a web forum :-)
  #11  
Old July 24th, 2005, 11:25 AM
frizzle
Guest
 
Posts: n/a
Default Re: Merge images / add logo

I wanted to give this message an extra boost, so it stays under the
attention, cause i'm really eager to know the solution ...

  #12  
Old July 24th, 2005, 07:55 PM
Default User
Guest
 
Posts: n/a
Default Re: Merge images / add logo

frizzle wrote:
[color=blue]
> I wanted to give this message an extra boost, so it stays under the
> attention, cause i'm really eager to know the solution ...[/color]


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
  #13  
Old July 26th, 2005, 04:35 PM
frizzle
Guest
 
Posts: n/a
Default Re: Merge images / add logo

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.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.