<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Transparent GIFs with PHP and GD</title>
	<atom:link href="http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/</link>
	<description>Personal Website of Adrian Mummey</description>
	<lastBuildDate>Sat, 20 Feb 2010 17:04:54 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: David Navratil</title>
		<link>http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/comment-page-1/#comment-1214</link>
		<dc:creator>David Navratil</dc:creator>
		<pubDate>Sat, 20 Feb 2010 17:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mummey.org/?p=5#comment-1214</guid>
		<description>Thanks alot, saved my day!

You can use the imagecopyresampled function, though, if you do not need to output as gif file, but (as I do) as PNG with transparency.

Best Regards,
Dave</description>
		<content:encoded><![CDATA[<p>Thanks alot, saved my day!</p>
<p>You can use the imagecopyresampled function, though, if you do not need to output as gif file, but (as I do) as PNG with transparency.</p>
<p>Best Regards,<br />
Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maralynn Rochat</title>
		<link>http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/comment-page-1/#comment-309</link>
		<dc:creator>Maralynn Rochat</dc:creator>
		<pubDate>Mon, 08 Jun 2009 21:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mummey.org/?p=5#comment-309</guid>
		<description>turns out that the imagegif($sprite1); function just needed its second argument.</description>
		<content:encoded><![CDATA[<p>turns out that the imagegif($sprite1); function just needed its second argument.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maralynn Rochat</title>
		<link>http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/comment-page-1/#comment-307</link>
		<dc:creator>Maralynn Rochat</dc:creator>
		<pubDate>Mon, 08 Jun 2009 17:00:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mummey.org/?p=5#comment-307</guid>
		<description>This worked awesome. One thing was that the browser printed a bunch of gobbly gook while it executed the script:

���x�+��%A&gt;�&quot;H&quot;��)���c����G(�й4Ё&amp;x&gt;��7 R(��r�X�!H �;B���( I(�)Ȁ/h�*�Z� 9��S��`��B��Gx�$T�� i��&amp;X�3�X�\

any idea why it would have done that??</description>
		<content:encoded><![CDATA[<p>This worked awesome. One thing was that the browser printed a bunch of gobbly gook while it executed the script:</p>
<p>���x�+��%A&gt;�&#8221;H&#8221;��)���c����G(�й4Ё&amp;x&gt;��7 R(��r�X�!H �;B���( I(�)Ȁ/h�*�Z� 9��S��`��B��Gx�$T�� i��&amp;X�3�X�\</p>
<p>any idea why it would have done that??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joshi</title>
		<link>http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/comment-page-1/#comment-264</link>
		<dc:creator>joshi</dc:creator>
		<pubDate>Thu, 14 May 2009 09:33:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.mummey.org/?p=5#comment-264</guid>
		<description>Thanks for doing the work of trial/error. I hate doing something like that. ;) 

I am actually using some of your ideas in a symfony plugin of mine, called sfFilebasePlugin, for image processing.

Greetings to mongolia
joshi</description>
		<content:encoded><![CDATA[<p>Thanks for doing the work of trial/error. I hate doing something like that. <img src='http://www.mummey.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
<p>I am actually using some of your ideas in a symfony plugin of mine, called sfFilebasePlugin, for image processing.</p>
<p>Greetings to mongolia<br />
joshi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Mummey</title>
		<link>http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/comment-page-1/#comment-94</link>
		<dc:creator>Adrian Mummey</dc:creator>
		<pubDate>Mon, 23 Mar 2009 02:15:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mummey.org/?p=5#comment-94</guid>
		<description>Unfortunately you cannot combine this with imageCopyResampled. imageCopyResample will alter the palette and transparency of you image. In order to use this method properly you can only use imageCopyResized. As of now the only solutions I have found are either: 1. Maintain transparency and use imageCopyResized OR 2. Lose transparency and use imageCopyResampled.
Here is a thread where it is discussed.&lt;a href=&quot;http://forums.devnetwork.net/viewtopic.php?f=40&amp;t=59825&quot; rel=&quot;nofollow&quot;&gt;
&lt;blockquote&gt;The problem is due to a combination of using imagecopyresampled(), and saving out to a gif afterwards. Gif files are pallette based, and can only have 1 transparency channel. When you copy an image with imagecopyresampled() it&#039;ll wipe out the current transparency channel and replace it with an alpha channel of per pixel transparency information. If you saved a PNG file it&#039;d work ok (obviously you&#039;d need the usual htc hack to get PNG transparency working in IE6), but as you&#039;re saving as a gif you&#039;re losing the transparency. Normally you&#039;d convert back to a color pallette using imagetruecolortopallette() but that throws up a couple of issues - first, it&#039;s a crap function that does a really bad job of choosing colours, and second, as you&#039;ve used imagecopyresampled() you&#039;re not going to have a single colour you can set as transparent any more.

The solution is to use imagecreate() in the first place to make an 8bit image canvas to copy to, and to use imagecopyresized() to copy the data. It will end up being nasty and blocky, but that&#039;s the price you pay for using gifs.&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>Unfortunately you cannot combine this with imageCopyResampled. imageCopyResample will alter the palette and transparency of you image. In order to use this method properly you can only use imageCopyResized. As of now the only solutions I have found are either: 1. Maintain transparency and use imageCopyResized OR 2. Lose transparency and use imageCopyResampled.<br />
Here is a thread where it is discussed.<a href="http://forums.devnetwork.net/viewtopic.php?f=40&#038;t=59825" rel="nofollow"></p>
<blockquote><p>The problem is due to a combination of using imagecopyresampled(), and saving out to a gif afterwards. Gif files are pallette based, and can only have 1 transparency channel. When you copy an image with imagecopyresampled() it&#8217;ll wipe out the current transparency channel and replace it with an alpha channel of per pixel transparency information. If you saved a PNG file it&#8217;d work ok (obviously you&#8217;d need the usual htc hack to get PNG transparency working in IE6), but as you&#8217;re saving as a gif you&#8217;re losing the transparency. Normally you&#8217;d convert back to a color pallette using imagetruecolortopallette() but that throws up a couple of issues &#8211; first, it&#8217;s a crap function that does a really bad job of choosing colours, and second, as you&#8217;ve used imagecopyresampled() you&#8217;re not going to have a single colour you can set as transparent any more.</p>
<p>The solution is to use imagecreate() in the first place to make an 8bit image canvas to copy to, and to use imagecopyresized() to copy the data. It will end up being nasty and blocky, but that&#8217;s the price you pay for using gifs.</p></blockquote>
<p></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: drifter</title>
		<link>http://www.mummey.org/2008/11/transparent-gifs-with-php-and-gd/comment-page-1/#comment-93</link>
		<dc:creator>drifter</dc:creator>
		<pubDate>Mon, 23 Mar 2009 02:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.mummey.org/?p=5#comment-93</guid>
		<description>thanks a lot for this solution, it works. but.. what about resizing? after using imageCopyResampled i got some dirts, like here:

http://drifter.flexx.pl/gif_resampled.gif

i don&#039;t know GD well enough to guess why..</description>
		<content:encoded><![CDATA[<p>thanks a lot for this solution, it works. but.. what about resizing? after using imageCopyResampled i got some dirts, like here:</p>
<p><a href="http://drifter.flexx.pl/gif_resampled.gif" rel="nofollow">http://drifter.flexx.pl/gif_resampled.gif</a></p>
<p>i don&#8217;t know GD well enough to guess why..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
