How To Create and Apply Image Filters in PHP
Added 9 Aug 2008
Most likely, the first time you heard about image filters was when you
had to edit your vacation pictures to remove the "red eye" effect or an
undesirable face. For such basic purposes, a little practice and some
specialized software such as Adobe Photoshop or Paint Shop Pro is
sufficient to end up with great pictures. But if you want to go beyond
the basics you need to understand what a picture actually is, what the
main algorithms dedicated to image processing are, and how a
programming language, as PHP per example, can help you. Images are
wonderfully malleable, and after you understand those points, you can
develop your own custom image filters with PHP. This article covers:
- Introduction to the GD library, which provides PHP support for image processing
- Creating custom image filters by modifying pixel colors
- Implementing the "convolution" technique
- Creating custom image filters by modifying pixel positions