spacer
Web Development Blog
 Developer Newsletter

Webmaster Blogs
Content & Blogging
Design
Photoshop
General
JavaScript
PHP
PHP Functions
Web
WordPress
Website Promotion

Blog Archives


Developer Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous

Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Webmaster Blog

8 Cool Functions in the GD2 extension

Most PHP developers have at least heard of GD2; thanks to its prolific use in CAPTCHA generation, the image functions in PHP are standard practice for many. But the extension’s uses don’t end there. After the fold, here are eight cool things you probably weren’t aware could be done with GD2, and might be useful for your web applications.

(Note that a few of these may not be available depending on your PHP/GD setup, check the manual)

  1. Get the size of an icon file, with getimagesize() (also works on all standard image formats)
  2. Apply a gaussian-blur to an image, with imagefilter()
  3. Rotate an image, with imagerotate()
  4. Flood-fill an area of an image, with imagefill()
  5. Grayscale an image, also with imagefilter()
  6. Draw polygons and arcs — maybe for mathematical diagram? — with imagepolygon() and imagearc()
  7. Copy and resize a section of an image, with imagecopyresized()
  8. “Sketchify” images for a pencil-illustration-style effect, also with imagefilter() (see a pattern here?)

The phpied blog has some cool demos of the imagefilter() function in particular.

Tags: , ,


Related Posts
» Creating facebook like popup dialog in your web app
» Say hello to namespace naming conventions!
» PEAR Text_Diff is now stable!
» Zend Framework: The Best Framework for Use With Other Frameworks
» An open source clone of Meebo is now available
 


Leave a Reply





About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: