Adding Edge to image with php
Moderators: onion2k, General Moderators
Adding Edge to image with php
Hi
I would like to add gradient edge to images (after uploaded)
I know that GD Lib can do this.
Does any one have some code sample ?
Thanks
moshe
I would like to add gradient edge to images (after uploaded)
I know that GD Lib can do this.
Does any one have some code sample ?
Thanks
moshe
-
litebearer
- Forum Contributor
- Posts: 194
- Joined: Sat Mar 27, 2004 5:54 am
Might look at this
http://www.scriptdungeon.com/script.php?ScriptID=865
Lite...
http://www.scriptdungeon.com/script.php?ScriptID=865
Very flexible thumbnail generator. Output larger/smaller than source, entire image or cropped section, with/without configurable borders and/or background color. Source can be local file, remote file or database source. GIF reading supported with or without GD support. BMP reading support. Optional watermarking, optional unsharp mask sharpening, optional caching. EXIF thumbnails can be extracted. Supports any input formats via ImageMagick if available. Works with any GD version, PHP v4.0.6+
Lite...
Gradient border to image- more info
Hi
Thanks for helping.
When someone on my site upload an image i want to stroke the border of the image with white faded border.
You might look at this image(it is a ready one) for what im looking for as a result:
http://www.beads4sure.com/images/23415352.jpg
thanks
moshe
Thanks for helping.
When someone on my site upload an image i want to stroke the border of the image with white faded border.
You might look at this image(it is a ready one) for what im looking for as a result:
http://www.beads4sure.com/images/23415352.jpg
thanks
moshe
Hey,
They affect is incrdibly difficult to acheive for someone with a lot of GD skill, best bet is to find an effect in the toolkit ^^ that is close, as without a lot of knowledge (or hiring someone) your going to struggle immensely;
Even if you got it to run, you could expect pretty high CPU load - as for the opacity you need calculate the colour, then the appropriate target colour after 1, 10, 20, 30% etc opacity yo get the fade (even if your not using transpacency, you have4 to calculate the shade of white to draw over the image).
The Alternative is to make `border` images, if all the images will be GD'd to the same size, then you can just make one image wtih a whitespace in the centre and `paste` your uploaded image onto it.
You might also considering making 4x corner images, and a top + left + bottom + right type images, and jigsawing those roungd your image --
if you let us know which would suit best (and try a few things -- paste them up) -- we can offer constyrctive criticism, and you'll find people more willing to help out too -
They affect is incrdibly difficult to acheive for someone with a lot of GD skill, best bet is to find an effect in the toolkit ^^ that is close, as without a lot of knowledge (or hiring someone) your going to struggle immensely;
Even if you got it to run, you could expect pretty high CPU load - as for the opacity you need calculate the colour, then the appropriate target colour after 1, 10, 20, 30% etc opacity yo get the fade (even if your not using transpacency, you have4 to calculate the shade of white to draw over the image).
The Alternative is to make `border` images, if all the images will be GD'd to the same size, then you can just make one image wtih a whitespace in the centre and `paste` your uploaded image onto it.
You might also considering making 4x corner images, and a top + left + bottom + right type images, and jigsawing those roungd your image --
if you let us know which would suit best (and try a few things -- paste them up) -- we can offer constyrctive criticism, and you'll find people more willing to help out too -
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Thank goodness for bank holidays .. I've written a class to make these sorts of thumbnails and added it to the list on phpgd.com ..
http://www.phpgd.com/scripts.php?script=39
Suprisingly complicated. I thought they'd be simpler when I started. At the moment there's no parameter to control the width of the gradient, only the size of the thumbnail and the color.
http://www.phpgd.com/scripts.php?script=39
Suprisingly complicated. I thought they'd be simpler when I started. At the moment there's no parameter to control the width of the gradient, only the size of the thumbnail and the color.
To save the file instead of outputting it to the browser, comment out the content type header and give the call to imagejpeg() a filename.
Code: Select all
//header("Content-type: image/jpeg;");
$i->imagejpeg("thumbnail.jpg");