<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 22 May 2013 14:41:56 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Philip Norton's Blog: Desaturate Images With PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16828</guid>
      <link>http://www.phpdeveloper.org/news/16828</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Philip Norton</i> shows how to <a href="http://www.hashbangcode.com/blog/desaturate-images-php-593.html">desturate images with PHP</a> using the already built-in <a href="http://php.net/gd">GD libraries</a> and the <a href="http://php.net/imagecopymergegray">imagecopymergegray</a> function.
</p>
<blockquote>
To desaturate an image means to remove all non-greyscale colours from it, essentially creating a black and white version. To do this you can use the function imagecopymergegray(), which is part of the GD image library. This function is a little difficult to figure out, but what is does is sample one image into another and optionally changing the amount of colours that are kept during the sampling process. The function can be made to sample just a section of the image, or the whole thing. 
</blockquote>
<p>
He also offers an alternative method that uses <a href="http://php.net/imagefilter">imagefilter</a> instead, passing it the IMG_FILTER_GRAYSCALE flag. Included is a full block of code for a method he recently included in a WordPress site to dynamically create thumbnails.
</p>]]></description>
      <pubDate>Wed, 07 Sep 2011 12:51:26 -0500</pubDate>
    </item>
  </channel>
</rss>
