Color replace

Recommend this page to a friend!

      IMGOut  >  All threads  >  Color replace  >  (Un) Subscribe thread alerts  
Subject:Color replace
Summary:need some feedback please...
Author:Joshua Reid
Date:2005-06-13 04:22:15
Update:2005-06-13 22:25:40

  1. Color replace   Reply   Report abuse  
Joshua Reid - 2005-06-13 04:22:15
Hi there - sorry to post query here - I need some feedback please...
I'm fairly new to GD and I want to composite a few 2color gif imgs on top of each other to create 1 final img, i am feeding my code with 2 color vars which will set the black on each gif color layer and leave white transparent. If i set colorAllocate to the var will it change the black to desired? I then merge those colored layers (with white transparent) and output final img...
Any help would be much appreciated!
Josh ;)

  2. Re: Color replace   Reply   Report abuse  
Dmitry A. Kirilin - 2005-06-13 12:47:53 - In reply to message 1 from Joshua Reid
You can declare any color transparent by calling ImageColorTransparent (instead of ImageColorAllocate), or use ImageColorAllocateAlpha to use alpha channel.

  3. Re: Color replace   Reply   Report abuse  
Joshua Reid - 2005-06-13 22:25:40 - In reply to message 2 from Dmitry A. Kirilin
Thanks I'll attack that now - the gif img layers are black and white - I want to set the black to the given var hex2rgb array and the imagecolortransparent white:

How to replace the black with hex(?)

$black = imagecolorallocate($im, hex2rgb[r],hex2rgb[g],hex2rgb[b]);

$white = imageColorAllocate ($im, 255, 255, 255);
$trans = imagecolortransparent($im,$white);

Thanks heaps?! ;)


For more information send a message to info at phpclasses dot org.