Forum Moderators: coopster

Message Too Old, No Replies

What can GD really do?

         

ahmedtheking

6:49 pm on Sep 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How far can we push GD? Can GD change the colour of an image? Can it add strips? Add cheques? Patterns, etc...?

For example, if you had a PNG24 image with a white shape, let's say a circle, how can GD do the above things?

coopster

3:09 pm on Sep 22, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Image [php.net] manipulation using PHP and the GD library is quite powerful. There are alternatives as well, like Imagemagick as mentioned in this past discussion [webmasterworld.com].

If you are curious as to some of the potential possibilities I would recommend searching and reading or perhaps even purchasing some books on PHP and Images.

TerranRich

2:11 am on Sep 23, 2006 (gmt 0)

10+ Year Member



I'm still discovering new things about the GD library that amazes me. So far, from what I've seen, with GD it is possible to replace one color in an image with another, make shapes (circles, boxes, etc.) and even fill them in with color, place text on your image. There are even extensions out there (such as Zend) that let you create 3D pie charts with GD (simple drawing of arcs and filling in with colors). Most of the add-ons are free.

GD is very powerful if you think about it. I made an online catalog for my employer that lets you, as an admin, update and add merchandise with appropriate images for different colors of the product, and it resizes the image twice -- once for site display (max width/height: 275 pixels) and again for thumnails in searches and browsing (max width/height: 100pixels I believe), and it only takes one of the sub-item images for thumbnail use.

GD can do a lot. If you want to do something in particular in GD & PHP, I'd be more than willing to give you some pointers.

ahmedtheking

9:44 pm on Sep 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it's true, I need to get me some books on GD! I mean I've delt with it before, you know basic stuff: Sticking a pointer here and there, merging images, downsizing and so on!

What I wanted to do is to define an image's pattern. For example: tell GD to stick chequers or strips on an image X wide and #*$!XX colour. Any pointers to tutorials or books that are worth reading?

whoisgregg

3:08 pm on Sep 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can do a lot by building a bunch of alpha transparent PNGs of different patterns. Then you can use those with imagecopymerge [php.net] to accomplish neat effects.

ahmedtheking

5:03 pm on Sep 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok cheers people! Anyone know any good books or online sites that go into GD?

jatar_k

5:54 pm on Sep 25, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could try this

[nyphp.org...]
and
[boutell.com...]

DrDoc

9:19 pm on Sep 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



... not to mention image conversion.

I have yet to encounter anything that can't be done with gd.

eelixduppy

9:20 pm on Sep 25, 2006 (gmt 0)



>>>I have yet to encounter anything that can't be done with gd.

I don't see it making me coffee every morning! ;)

...yet

DeathRay2K

3:51 am on Sep 26, 2006 (gmt 0)

10+ Year Member



There really isn't anything it can't do with images.
The only real question is how efficiently it does things, and really, its not great for everything (or very much) in that respect.
Anything involving loops and large images can take ages to finish, when it could be done in Photoshop in 2 minutes.

Then again, ImageMagick is as far as I know the only alternative, and its not nearly as easy to work with.

ahmedtheking

8:10 am on Sep 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not looking to create huge 8MP images, just a few simple patterns here and there! I'd rather that GD created the image and saved it to cache than me creating over 1000 images myself!