What features would you like included in an image manipulati

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

What features would you like included in an image manipulati

Post by bokehman »

What features would you like to see included in an image manipulation class?
  • resizing
  • cropping
  • text and image based watermarks
  • grayscale
  • unsharpmask
  • maintained transparency and alpha channel


What else would you like to see included?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Depends on what the aim of the class was. If it was a "tool box" class I'd want everything you suggest there, plus flipping, convolution, channels, colour manipulation (hue replace, saturation, gamma), a few effects (paint, twirl, etc), a few basic drawing tools (text, polygons).. lots of stuff.

But I'm not exactly your average PHP GD user.
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

onion2k wrote:convolution
I'm not that hot on the terminology. Isn't that just like unshark mask? Or is it something very different.

Flipping would be no problem. I'm thinking of adding cloning and edge detection.
User avatar
aerodromoi
Forum Contributor
Posts: 230
Joined: Sun May 07, 2006 5:21 am

Re: What features would you like included in an image manipu

Post by aerodromoi »

bokehman wrote:What features would you like to see included in an image manipulation class?
  • resizing
  • cropping
  • text and image based watermarks
  • grayscale
  • unsharpmask
  • maintained transparency and alpha channel


What else would you like to see included?
Something for the gallery: shadows ;)

aerodromoi
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

bokehman wrote:
onion2k wrote:convolution
I'm not that hot on the terminology. Isn't that just like unshark mask? Or is it something very different.
http://mathworld.wolfram.com/Convolution.html

:)

It's a process whereby you multiply each pixel in the image by a factor of it's bordering pixels.. http://docs.gimp.org/en/plug-in-convmatrix.html explains it fairly well. You can do things like blurring, embossing, and edge detection with it. Check phpgd.com for a couple of examples, one with a 1D filter, and one with a 2D filter.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: What features would you like included in an image manipu

Post by onion2k »

User avatar
aerodromoi
Forum Contributor
Posts: 230
Joined: Sun May 07, 2006 5:21 am

Re: What features would you like included in an image manipu

Post by aerodromoi »

onion2k wrote:
aerodromoi wrote:Something for the gallery: shadows ;)
http://www.phpgd.com/scripts.php?script=24
http://www.phpgd.com/scripts.php?script=26
Right now I'm happy with my own resize and crop function, but looking beyond my nose won't hurt me ;)

Thnx,
aerodromoi
Li0rE
Forum Commoner
Posts: 41
Joined: Wed Jun 07, 2006 6:26 am

Post by Li0rE »

I dont really know what to suggest, except that you shouldnt use imagecopyresized, use imagecopyresampled.
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

on the fly PHP Image Manipulation takes it's toll and it's fast whatsoever. i say for the most part do all of that in GIMP/Photoshop.

on my actual websites i never do on the fly image amnipulation. resize, watermark whatever. doesn't matter. i do batch jobs, hand jobs (*giggle*) or whatever in order to get it done on my system. i don't want to waste bandwidth resizing tens or more pictures at once.

but that's just my opinon
User avatar
aerodromoi
Forum Contributor
Posts: 230
Joined: Sun May 07, 2006 5:21 am

Post by aerodromoi »

MrPotatoes wrote:on the fly PHP Image Manipulation takes it's toll and it's fast whatsoever. i say for the most part do all of that in GIMP/Photoshop.

on my actual websites i never do on the fly image amnipulation. resize, watermark whatever. doesn't matter. i do batch jobs, hand jobs (*giggle*) or whatever in order to get it done on my system. i don't want to waste bandwidth resizing tens or more pictures at once.

but that's just my opinon
You've got a point there. Adding watermarks and image manipulation is imho better left to dedicated software.
However, when it comes to thumbnailing images, the GD library comes in handy. You don't have to do it on the fly, though.

Anyway, it's not the bandwidth that matters in this case - it's the cpu usage.

aerodromoi
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

MrPotatoes wrote:on the fly PHP Image Manipulation takes it's toll and it's fast whatsoever. i say for the most part do all of that in GIMP/Photoshop.
Two completely seperate areas of web development there. Noone would suggest using GD in place of Photoshop* to design your website's graphics. On the other hand though, Photoshop is useless if you want to thubnail/watermark images uploaded by users.

* Except me. I've written a PHP graphics package thing. For a laugh.
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

onion2k wrote:
MrPotatoes wrote:on the fly PHP Image Manipulation takes it's toll and it's fast whatsoever. i say for the most part do all of that in GIMP/Photoshop.
Two completely seperate areas of web development there. Noone would suggest using GD in place of Photoshop* to design your website's graphics. On the other hand though, Photoshop is useless if you want to thubnail/watermark images uploaded by users.

* Except me. I've written a PHP graphics package thing. For a laugh.
that my friend is a good point. i didn't think of that. if it's from users definatly. i usually see my systems from the admin side and users are a second thought. not as in i don't care because i do. but because i should control the system. so that's where i come from. otherwise you are right.

it's just that image manipulation is soooooooo slow on the PHP side.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

MrPotatoes wrote:it's just that image manipulation is soooooooo slow on the PHP side.
Normal stuff like thumbnails and watermarking is fast enough to be indistinguishable from downloading a static image. And with cache'ing you only do the image manipulation once anyway. So speed isn't really an issue.

It's possible to make things that go a lot slower.. http://www.phpgd.com/temp/fire_ordered.jpg was made by my PHP hue replacement code, and took about 20 minutes to run.. That's the sort of thing I find fun though.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

MrPotatoes wrote:on the fly PHP Image Manipulation takes it's toll and it's fast whatsoever. i say for the most part do all of that in GIMP/Photoshop.

on my actual websites i never do on the fly image amnipulation. resize, watermark whatever. doesn't matter. i do batch jobs, hand jobs (*giggle*) or whatever in order to get it done on my system. i don't want to waste bandwidth resizing tens or more pictures at once.

but that's just my opinon
2 comments...

1) I'm willing to bet that GD is as fast as GIMP so the slight overhead in PHP bindings is all that you pay for...you could cache results on the server for the same effect as using GIMP, Photoshop, etc...

2) It's not bandwidth you are using it's CPU cycles or possibly a dedicated chip intended for rendering graphics

Cheers :)
User avatar
nathanr
Forum Contributor
Posts: 200
Joined: Wed Jun 07, 2006 5:46 pm

Post by nathanr »

I still want circular images, not a circle in a square, a proper vector like circle image which text can wrap around, please. Oh and a clipping path filter that knows what you want to cut out and does it just right.

thankyou please
Post Reply