zanix wrote:Now about the background transparency thing
As soon as you figure out a good way around it let me know.
I've been attempting to make some progress with my SigGen hacking and decided to start here. After a little bit of research, I seem to have discovered the way to make GIF signatures honor the background transparency and it only required 2 new lines of code (at least for my own specific purposes).
Here are the 3 existing lines of code from the makeImageGif() function followed by my additions:
- Code: Select all
$im_gif = @imagecreatetruecolor( $w,$h )
or debugMode((__LINE__),$php_errormsg);
$trans = imagecolorat($im_gif, 0, 0);
imagecolortransparent($im_gif, $trans);
What I'm doing there is looking at the top left pixel (0,0) of the border image and setting whatever it finds there as the color to be made transparent.
Since my border image is a PNG graphic with alpha transparency, it basically sets the color to true black (#000000). I modified my SigGen text colors accordingly, making the default black text something slightly off of true black just to avoid having it become transparent, as well.
My method isn't perfect, obviously. It depends on the top left pixel of the border image to be either transparent or the color you want to make transparent for the final signature. There is also an anomaly that I can't track down.
See that 1px wide black line down the lefthand side of the signature? There's nothing there in the source images. I can't figure out where it's coming from.
Anyhow, that's just a mockup (nowhere near final design) of an idea I had to try to make the character image pop out a little more from the signature itself. It still needs a lot of work, and my rough little addition to your code needs a bit more tweaking, but I thought I'd share it in case you found it useful as a starting point for trying to get this integrated into future releases.
Cheers.