Slovenia2009-04_658norge5oslo_169Helsinki2005-10-15_16_042Zoo2006-10-07_043Kuortti.2010-06-26Kuortti.2010-06-26Nanbudo_Norge2007-12_211Saaristoleiri-Uto-2008_180playa06secret_552Helsinki2005-10-15_16_019italia2005-05_131Kobe, Japan 2010-05-01Naginata Helsinki 2010-02-07 09Saaristoleiri 2009-08 34Somero2002_02South.Africa.Roadtrip.2007-08_216Kobe, Japan 2010-04-28Oslo.Norway.2002.summer.034South.Africa.Roadtrip.2007-08_353italia2005-04_219Jodo-Milano.2008-09_035Nanbudo_WCh2006_076
Move your hips

There are few hiking trails in the surroundings of Ljubljana, Slovenia. Some of them have these guided exercise tracks.

Image filtering in PHP 5 with GD extension

PHP includes simple image filtering capabilities provided by the GD extension.

The following filters are available, listed as the PHP constants:

  • IMG_FILTER_NEGATE
  • IMG_FILTER_GRAYSCALE
  • IMG_FILTER_BRIGHTNESS
  • IMG_FILTER_CONTRAST
  • IMG_FILTER_COLORIZE
  • IMG_FILTER_EDGEDETECT
  • IMG_FILTER_EMBOSS
  • IMG_FILTER_GAUSSIAN_BLUR
  • IMG_FILTER_SELECTIVE_BLUR
  • IMG_FILTER_MEAN_REMOVAL
  • IMG_FILTER_SMOOTH

Some of them can be adjusted with additional parameters, such as contrast and smooth.

imagefilter($image_resource, FILTER)

Image resource can be created simply from an existing image by using function such as:

$image_resource = imagecreatefromjpeg("laughing-monkey.jpg");

Next step usually is to output the filtered image. This can be done in two ways by using the same function, print to browser or save to a local file. If you do not define the second parameter, the image will be shown to the browser.

imagejpeg($image_resource, "laughing-monkey-filtered.jpg");

A working example of all the filters is available here, applied to my story image thumbnails.

Time: 31/03/2008 22:01

QR code for paazio.nanbudo.fi