Home arrow PHP arrow Filtering Image Streams with the GD Library in PHP

Filtering Image Streams with the GD Library in PHP

Building and processing dynamic images with PHP is a procedure that can be easily tackled with the GD extension. If you want to learn how to put its main functions to work for you, then you should start reading this tutorial right now!

  1. Filtering Image Streams with the GD Library in PHP
  2. Manipulating the colors of an image stream
  3. Controlling brightness and contrast with the imagefilter() function
  4. More graphic filters with the imagefilter() function
By: Alejandro Gervasio
Rating: starstarstarstarstar / 5
August 27, 2007

print this article




Welcome to the final installment of the series that began with "A Close Look at the GD Library in PHP." Comprised of five articles, this series introduces the most common operations that you can perform with this graphic-processing package. These range from creating basic image streams from scratch to performing more complex operations such as drawing shapes and filtering graphics.

As usual with many of my articles on web development, before I move on and continue exploring some additional functions integrated with the GD extension, I'd like to refresh the topics treated in the previous article of the series. This will give you a better idea of how the respective functions discussed in that tutorial can be linked with the ones that I plan to cover in the next few sentences.

Having said that, you'll surely recall that in the preceding article of the series I showed you how to display on the browser some basic filled shapes, including simple rectangles, ellipses and more complex polygons. In addition, I explained how to utilize the handy "imagex()", "imagey()" and "getimagesize()" functions to retrieve the width and height values for a given image stream, as well as determining its MIME type. As you can see, the GD extension has plenty of power when it comes to fetching useful data about a particular graphic, whether that graphic was created dynamically or generated from an existing picture.

All right, having summarized the concepts that I covered so far, in this article I'm going to demonstrate how the GD library can be used to apply some basic graphic filters (yes, like Photoshop, but much simpler) by utilizing the versatility of a brand new function called "imagefilter()".

As you'll see shortly, with this function it is possible to reverse, blur and highlight the colors of a determined image, as well as convert it to its grayscale version, among other things. Sounds pretty interesting, right?

So, are you ready to find out how to apply some basic graphic filters to a given image stream using the GD extension? Okay, let's get started!

>>> More PHP Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: