<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Che Hodgins &#187; imagemagick</title>
	<atom:link href="http://www.chehodgins.com/tag/imagemagick/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chehodgins.com</link>
	<description>Musings on Web Development</description>
	<lastBuildDate>Wed, 15 Sep 2010 21:35:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Why does JPEG rock the web?</title>
		<link>http://www.chehodgins.com/web/why-does-jpeg-rock-the-web/</link>
		<comments>http://www.chehodgins.com/web/why-does-jpeg-rock-the-web/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 13:10:10 +0000</pubDate>
		<dc:creator>chehodgins</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[png vs jpeg]]></category>
		<category><![CDATA[pngcrush]]></category>

		<guid isPermaLink="false">http://www.chehodgins.com/blog/?p=3</guid>
		<description><![CDATA[In short, because it is the ideal format for most situations. This webcomic summarizes the views of many developers when comes the question of what image formats to use on the web. For those who don&#8217;t get the joke, JPEG is a lossy format, meaning that each time the file is edited there is a [...]]]></description>
			<content:encoded><![CDATA[<p>In short, because it is the ideal format for most situations.</p>
<p>This <a title="Always use JPEG?" href="http://lbrandy.com/blog/2008/10/my-first-and-last-webcomic/">webcomic</a> summarizes the views of many developers when comes the question of what image formats to use on the web.</p>
<p>For those who don&#8217;t get the joke, JPEG is a lossy format, meaning that each time the file is edited there is a degradation in quality. That&#8217;s why the JPEG side of the comic contains visual artifacts.</p>
<p>JPEG&#8217;s popularity is helped by the fact that it is the default image file format of most digital cameras, making it the most common image format on the web.</p>
<p>I love JPEG&#8217;s too, but I understand that they are not the solution to every problem. In general I believe its a simple solution to determine which format to use.</p>
<ul>
<li>If your image has many colors (such as pictures) I recommend using JPEG.</li>
<li>If small file size is important or your image has less colors (like icons, buttons) I recommending trying PNG8, which produces a 256 color PNG. As points out <a title="smush expert" href="http://yuiblog.com/blog/2008/11/04/imageopt-2/">Stoyan Stefanov</a>, the human eye has difficulty telling the difference between 200 and 1000 colors. If it looks good then go for it.</li>
</ul>
<p>I recently setup a command line solution for converting and compressing images from JPEG to PNG8 using <a href="http://www.imagemagick.org">ImageMagick </a>and <a href="http://pmt.sourceforge.net/pngcrush/">PNGCrush</a>.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">convert ~<span style="color: #000000; font-weight: bold;">/</span>jpgs<span style="color: #000000; font-weight: bold;">/</span>file.jpg PNG8:~<span style="color: #000000; font-weight: bold;">/</span>pngs<span style="color: #000000; font-weight: bold;">/</span>file.png<br />
pngcrush <span style="color: #660033;">-rem</span> gAMA <span style="color: #660033;">-rem</span> cHRM <span style="color: #660033;">-rem</span> iCCP <span style="color: #660033;">-rem</span> sRGB ~<span style="color: #000000; font-weight: bold;">/</span>pngs<span style="color: #000000; font-weight: bold;">/</span>file.png ~<span style="color: #000000; font-weight: bold;">/</span>crushed<span style="color: #000000; font-weight: bold;">/</span>file.png</div></td></tr></tbody></table></div>
<p>By also stripping out the color correction I was able to reduce the size on average by 50% for 290&#215;290 image sizes without any visible loss of quality. This can give a real front-end performance boost on web pages that contain many images.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chehodgins.com/web/why-does-jpeg-rock-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

