title: PHP: grayscale jpgs, gifs, pngs... also with alpha channels?
body: <p>$im = ImageCreateFromString(file_get_contents($source_file));
      ImageFilter($im, IMG_FILTER_GRAYSCALE);</p>
  
  <p>any idea what i could do, to properly grayscale gifs and pngs with transperancy? This snippet actually works good, it transforms jpgs and pngs to grayscale. However gifs are a little bit "buggy" - they don't always work, it depends on the image. Sometimes there are a few pale colors left in them. Moreover this snippet doesn't work with alpha-channels. If i convert a gif or a png with transparancy the transparent parts always get blackened.</p>
  
  <p>Of course im querying the image-type and after "grayscaling" it, i'll set the proper type again. </p>
  
  <p>Have you any ideas?</p>