<?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>optimization &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/optimization/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Optimizing OpenLayers. Speed up markers load time!</title>
		<link>/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/</link>
		<comments>/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 07:03:08 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[appendChild]]></category>
		<category><![CDATA[marker]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">/?p=1051</guid>
		<description><![CDATA[Icons in OpenLayers! They chain of classes used to construct and make one single marker in OpenLayers is a bit difficult to follow, but isn&#8217;t impossible. There are three main classes in three files: Markers.js Layer/Markers.js Icon.js That&#8217;s why after tracking the code in them I noticed the library&#8217;s using appendChild in a line like &#8230; <a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" class="more-link">Continue reading <span class="screen-reader-text">Optimizing OpenLayers. Speed up markers load time!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
<li><a href="/2009/07/24/javascript-detect-browser-speed-and-load-the-slow-connection-site/" rel="bookmark" title="javascript: detect browser speed and load the &#8220;slow connection&#8221; site version">javascript: detect browser speed and load the &#8220;slow connection&#8221; site version </a></li>
<li><a href="/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/" rel="bookmark" title="OpenLayers extreme optimization. Cut, compress and deploy!">OpenLayers extreme optimization. Cut, compress and deploy! </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Icons in OpenLayers!</h2>
<p>They chain of classes used to construct and make one single marker in OpenLayers is a bit difficult to follow, but isn&#8217;t impossible. There are three main classes in three files:</p>
<pre lang="javascript">Markers.js
Layer/Markers.js
Icon.js</pre>
<p>That&#8217;s why after tracking the code in them I noticed the library&#8217;s using appendChild in a line like that:</p>
<pre lang="javascript">this.div.appendChild(markerImg);</pre>
<p>The problem is that if you&#8217;ve a loop with probably hundreds of iterations this is really slow. What I intent to do is to return only the generated code as string, or instead of returning the element, I can return the string. Than concatenate it after the loop&#8217;s over.</p>
<p>That will be way faster!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
<li><a href="/2009/07/24/javascript-detect-browser-speed-and-load-the-slow-connection-site/" rel="bookmark" title="javascript: detect browser speed and load the &#8220;slow connection&#8221; site version">javascript: detect browser speed and load the &#8220;slow connection&#8221; site version </a></li>
<li><a href="/2010/02/08/openlayers-extreme-optimization-cut-compress-and-deploy/" rel="bookmark" title="OpenLayers extreme optimization. Cut, compress and deploy!">OpenLayers extreme optimization. Cut, compress and deploy! </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What should be optimized in one web page?</title>
		<link>/2010/01/11/what-should-be-optimized-in-one-web-page/</link>
		<comments>/2010/01/11/what-should-be-optimized-in-one-web-page/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 06:29:49 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[Hypertext]]></category>
		<category><![CDATA[New encyclopedism]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[Program optimization]]></category>
		<category><![CDATA[Scientific revolution]]></category>
		<category><![CDATA[server site]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[web development experience]]></category>
		<category><![CDATA[Web page]]></category>
		<category><![CDATA[web project]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">/?p=877</guid>
		<description><![CDATA[Well that&#8217;s a question that has been asked so many times in the web and I my intention is not to repeat that. In my web development experience after so many web sites behind my back, there is always something that repeats in every site. And that&#8217;s the technology that support the development &#8211; the &#8230; <a href="/2010/01/11/what-should-be-optimized-in-one-web-page/" class="more-link">Continue reading <span class="screen-reader-text">What should be optimized in one web page?</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/01/18/what-should-i-optimize-first-in-my-web-page/" rel="bookmark" title="What should I optimize first in my web page?">What should I optimize first in my web page? </a></li>
<li><a href="/2009/05/10/phpini-for-two-web-servers/" rel="bookmark" title="php.ini for two web servers">php.ini for two web servers </a></li>
<li><a href="/2010/01/13/optimizing-the-web-start-with-the-images/" rel="bookmark" title="Optimizing the web. Start with the images!">Optimizing the web. Start with the images! </a></li>
<li><a href="/2011/01/27/few-thoughts-on-web-video/" rel="bookmark" title="Few Thoughts on Web Video">Few Thoughts on Web Video </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Well that&#8217;s a question that has been asked so many times in the web and I my intention is not to repeat that. In my web development experience after so many web sites behind my back, there is always something that repeats in every site. And that&#8217;s the technology that support the development &#8211; the languages we use. Although they differ in some way, especially those used on the server site, or so called server scripts, which can vary between many options, but in fact almost every web project consist of one of the following things:</p>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>Flash or Silverlight</li>
<li>Server side scripting language, like PHP, ASP or whatever</li>
<li>Database server</li>
</ul>
<p>I&#8217;d like to add one category more and that&#8217;s the images we use in every website to construct the desirable layout. They are extremely important when optimizing a web page, because almost always they make more than half of the traffic of a page.</p>
<p>In few posts I&#8217;ll write what and how can be optimized, according to my experience and according to the articles I&#8217;ve read. I won&#8217;t mention again why the optimization is important &#8211; I&#8217;ve written already some posts about that and the web is full of articles.</p>
<p>As I can say nowadays this is the most important topic of the web development. Almost everyone&#8217;s speaking about it and I&#8217;d like to give some references in my talks, just to make it more clear and to give you some basic points from where you can start optimizing.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/01/18/what-should-i-optimize-first-in-my-web-page/" rel="bookmark" title="What should I optimize first in my web page?">What should I optimize first in my web page? </a></li>
<li><a href="/2009/05/10/phpini-for-two-web-servers/" rel="bookmark" title="php.ini for two web servers">php.ini for two web servers </a></li>
<li><a href="/2010/01/13/optimizing-the-web-start-with-the-images/" rel="bookmark" title="Optimizing the web. Start with the images!">Optimizing the web. Start with the images! </a></li>
<li><a href="/2011/01/27/few-thoughts-on-web-video/" rel="bookmark" title="Few Thoughts on Web Video">Few Thoughts on Web Video </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/01/11/what-should-be-optimized-in-one-web-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>sprite usage and website optimization</title>
		<link>/2009/06/21/sprite-usage-and-website-optimization/</link>
		<comments>/2009/06/21/sprite-usage-and-website-optimization/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 12:49:57 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[spritegen]]></category>

		<guid isPermaLink="false">/?p=617</guid>
		<description><![CDATA[What&#8217;s a sprite? When a website is developed common scenario is to put all of your images used in the UI in a .css file. Yes some did not use it, which I think is too much old school, but however maybe 99.9% did make it that way. In fact in nowadays sites we&#8217;ve more &#8230; <a href="/2009/06/21/sprite-usage-and-website-optimization/" class="more-link">Continue reading <span class="screen-reader-text">sprite usage and website optimization</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/02/05/css-sprites-go-beyond-the-limits-with-base64/" rel="bookmark" title="CSS sprites. Go beyond the limits with base64!">CSS sprites. Go beyond the limits with base64! </a></li>
<li><a href="/2009/10/06/css-sprites-common-mistakes/" rel="bookmark" title="CSS Sprites &#8211; common mistakes">CSS Sprites &#8211; common mistakes </a></li>
<li><a href="/2010/01/13/optimizing-the-web-start-with-the-images/" rel="bookmark" title="Optimizing the web. Start with the images!">Optimizing the web. Start with the images! </a></li>
<li><a href="/2011/01/07/more-on-css-optimization/" rel="bookmark" title="More on CSS Optimization">More on CSS Optimization </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>What&#8217;s a sprite?</h2>
<p>When a website is developed common scenario is to put all of your images used in the UI in a .css file. Yes some did not use it, which I think is too much old school, but however maybe 99.9% did make it that way. In fact in nowadays sites we&#8217;ve more and more rounded corners, more alpha in our images. But what&#8217;s a sprite at all.</p>
<p>Well imagine you&#8217;ve 20 of these images requested in you .css file, if we suggest we&#8217;ve only one stylesheet file. Than when your page is rendered into a browser there must be 20 requests to the server for those images. And so many requests may really slow down your page load. Using only one image with correct</p>
<blockquote>
<pre>background-image
background-position</pre>
</blockquote>
<p>properties in you css make your site load really fast.<span id="more-617"></span></p>
<h2>What&#8217;s website optimization?</h2>
<p>Most of the beginners think that a website is always fast. That&#8217;s true until you start making really big sites. Like Youtube, Vimeo, Yahoo, etc. Take a look at their css files and the background images in them. Yes, they are using sprites &#8211; those big images containing all of the background needed for the page. And than the page load may become much faster.</p>
<h2>How a sprite can change my load time?</h2>
<p>In my case the site loaded for 4 to 5 seconds on a normal speed connection. Than only by making a sprite from our 10 images in the background, it became between 3 and 4 sec. That&#8217;s 20%, and 1 second is not so bad in todays&#8217; web space.</p>
<h2>How to make it?</h2>
<p>You must make your background images as one sprite. At all that may become good practice for the future where for sure there will be only that way. OK, but how I can make it. Well you can generate it online simply by using something like <a title="Sprite Generator" href="http://spritegen.website-performance.org/" target="_blank">http://spritegen.website-performance.org/</a> or you can make it alone with some image manipulation programe as GIMP or Adobe Photoshop, it&#8217;s up to you.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/02/05/css-sprites-go-beyond-the-limits-with-base64/" rel="bookmark" title="CSS sprites. Go beyond the limits with base64!">CSS sprites. Go beyond the limits with base64! </a></li>
<li><a href="/2009/10/06/css-sprites-common-mistakes/" rel="bookmark" title="CSS Sprites &#8211; common mistakes">CSS Sprites &#8211; common mistakes </a></li>
<li><a href="/2010/01/13/optimizing-the-web-start-with-the-images/" rel="bookmark" title="Optimizing the web. Start with the images!">Optimizing the web. Start with the images! </a></li>
<li><a href="/2011/01/07/more-on-css-optimization/" rel="bookmark" title="More on CSS Optimization">More on CSS Optimization </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/06/21/sprite-usage-and-website-optimization/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>When you should use base64 for images</title>
		<link>/2009/04/23/when-you-should-use-base64-for-images/</link>
		<comments>/2009/04/23/when-you-should-use-base64-for-images/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 05:43:18 +0000</pubDate>
		<dc:creator><![CDATA[stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[html document]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[request]]></category>
		<category><![CDATA[response]]></category>

		<guid isPermaLink="false">/?p=538</guid>
		<description><![CDATA[When you should use base64 for images<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/02/05/css-sprites-go-beyond-the-limits-with-base64/" rel="bookmark" title="CSS sprites. Go beyond the limits with base64!">CSS sprites. Go beyond the limits with base64! </a></li>
<li><a href="/2010/01/13/optimizing-the-web-start-with-the-images/" rel="bookmark" title="Optimizing the web. Start with the images!">Optimizing the web. Start with the images! </a></li>
<li><a href="/2009/04/07/optimize-your-images-improve-the-performance/" rel="bookmark" title="Optimize your images &#8211; improve the performance">Optimize your images &#8211; improve the performance </a></li>
<li><a href="/2010/07/01/replace-the-broken-images-with-a-default-image-with-javascript/" rel="bookmark" title="Replace the Broken Images with a Default Image with JavaScript">Replace the Broken Images with a Default Image with JavaScript </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Base64 and image files</h2>
<p>For those who don&#8217;t know base64 it&#8217;s an encoding format for any data. In that case with the images we can simply say, that base64 equals to text (string) representation of the image itself. In most cases you&#8217;ve image tags with src attribute pointing to the http source of the image.</p>
<h2>Overview of the problem</h2>
<p>Let&#8217;s say we&#8217;ve a HTML document with 100 images into. That&#8217;s a rare case I agree, but sometimes it happens. You&#8217;ve to preload the thumbnails of an image gallery where only one image is displayed in a bigger size. As I mentioned before the progressive JPEG suits better for a large image but for the thumbnails you&#8217;ve to use baseline JPEGs.</p>
<p><em>Note: In fact the technique with base64 representation of the images is not well known. I think that&#8217;s because there are not so much examples with pages with more than 100 images.</em></p>
<p>But anyway. We&#8217;ve the HTML document with 100 images (100 &lt;img&gt; tags). That means directly 101 requests/responses from the server. In my tests on my localhost, which is supposed to be fast enough, that case loaded 2 MB with a simple small JPEG for the image, loaded 100 times, and approximately 3 seconds. Which yet again on the localhost is extreamly slow. The image is on my machine, the server is here&#8230; what else?</p>
<h2>How to put the images inline?</h2>
<p>The other way to do that is to put all you images in you HTML document. Than the first and more important rule for optimization (see more <a title="Steve Souders faster pages" href="http://video.stoimen.com/2009/04/17/steve-souders-high-performance-web-sites-14-rules-for-faster-pages/" target="_blank">here</a>), to make fewer requests is done. You now have only one request. And with the response you&#8217;ve all 100 images. That&#8217;s good when you&#8217;ve different images, cause every repeatable element in your CSS should be made with HTTP request once and than repeated with the CSS. In other way you risk the size of the document transfered in the web.</p>
<h2>The results</h2>
<p>The second case with the inline images and the only one request is giving me an average response time of 900ms. The size of the document is bigger, yes. I had 5KB for the HTML with no base64 images, and then the size increased to 45KB. That&#8217;s 9 times more. But however 45KB is nothing for the web, instead of all those 2 MB in the previous test.</p>
<h2>How to make your images to strings?</h2>
<p>Speaking in PHP terminology there is a function called base64_encode, which with a combination of file_get_contents(imagefile), make the files a base64 string.</p>
<h2>Is there any issue?</h2>
<p>Yes there is. First you cannot have your image files in a remote server, cause file_get_contents must read only from the local filesystem. Than if you process all those files before returning them to the client, where&#8217;s the point? You lose all that time you&#8217;ve spent with the technique.</p>
<h2>The reasonable solution</h2>
<p>I think this technique is good for cases like the one described at the beggining. You&#8217;ve a page with more than 100 images. Then you&#8217;ve the base64 representation already. Let say you have it in your database as string and don&#8217;t need to convert it everytime you return the image. That may happen on upload of the image and the image enters the database with its base64 representation, and it&#8217;s done.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/02/05/css-sprites-go-beyond-the-limits-with-base64/" rel="bookmark" title="CSS sprites. Go beyond the limits with base64!">CSS sprites. Go beyond the limits with base64! </a></li>
<li><a href="/2010/01/13/optimizing-the-web-start-with-the-images/" rel="bookmark" title="Optimizing the web. Start with the images!">Optimizing the web. Start with the images! </a></li>
<li><a href="/2009/04/07/optimize-your-images-improve-the-performance/" rel="bookmark" title="Optimize your images &#8211; improve the performance">Optimize your images &#8211; improve the performance </a></li>
<li><a href="/2010/07/01/replace-the-broken-images-with-a-default-image-with-javascript/" rel="bookmark" title="Replace the Broken Images with a Default Image with JavaScript">Replace the Broken Images with a Default Image with JavaScript </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/04/23/when-you-should-use-base64-for-images/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Optimize your images &#8211; improve the performance</title>
		<link>/2009/04/07/optimize-your-images-improve-the-performance/</link>
		<comments>/2009/04/07/optimize-your-images-improve-the-performance/#respond</comments>
		<pubDate>Tue, 07 Apr 2009 05:39:19 +0000</pubDate>
		<dc:creator><![CDATA[stoimen]]></dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[alphaimageloader]]></category>
		<category><![CDATA[baseline]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[png32]]></category>
		<category><![CDATA[png8]]></category>
		<category><![CDATA[progressive]]></category>
		<category><![CDATA[transparency]]></category>

		<guid isPermaLink="false">/?p=473</guid>
		<description><![CDATA[Learn the differences between image formats<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/04/23/when-you-should-use-base64-for-images/" rel="bookmark" title="When you should use base64 for images">When you should use base64 for images </a></li>
<li><a href="/2010/01/13/optimizing-the-web-start-with-the-images/" rel="bookmark" title="Optimizing the web. Start with the images!">Optimizing the web. Start with the images! </a></li>
<li><a href="/2010/07/01/replace-the-broken-images-with-a-default-image-with-javascript/" rel="bookmark" title="Replace the Broken Images with a Default Image with JavaScript">Replace the Broken Images with a Default Image with JavaScript </a></li>
<li><a href="/2011/07/29/php-strings-how-to-get-the-extension-of-a-file/" rel="bookmark" title="PHP Strings: How to Get the Extension of a File">PHP Strings: How to Get the Extension of a File </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Overview</h2>
<p>In a series of articles I&#8217;ll share what&#8217;s my experience with image optimization. Of course the most images you have the most page weight you have. That&#8217;s why optimizing your images should be your primary task.</p>
<h2>Image Formats</h2>
<p>First, I&#8217;m gonna mention several formats, which everyone of the webdevs are using widely. There are GIF, JPEG and PNG, where PNG can be either PNG8 and PNG24 (PNG32 is also available as name of that format).</p>
<p>What are the differences between them and when to use one or another?</p>
<p>Well some of us just use one or another even without knowing the difference or without thinking about the optimization. I remember when I just put the images in JPEG with no idea what are the other formats before.</p>
<p>In fact all the formats has pros and cons.</p>
<h2>JPEG</h2>
<p>The JPEG format can be either progressive or baseline. The difference is that the progressive JPEG can be loaded directly in the browser with very low quality and then to load with better quality. Some experts insist that this is old school, but I don&#8217;t think so. When the image is not the required one (think of a wallpaper preview) the user can skip and go to another without waiting the hole image. The baseline JPEG is loading the good quality image but starting from top to bottom. With portions of the image.</p>
<h3>IE and progressive JPEGs</h3>
<p>Of course the Internet Explorer 6 don&#8217;t support the progressive downloading of an JPEG even if it&#8217;s progressive. Well this is no issue till the IE loads the image like a baseline JPEG.</p>
<h3>Which JPEG is progressive and which is baseline</h3>
<p>You can certainly make some test to determine which JPEG is progressive and which is baseline, from the loading behaviour in your browser. If you&#8217;d like to convert an image to a progressive JPEG or baseline you can use a free open source programs out there in the wild online space. Once they are converted to one or another format you can use them widely. Because most of the tools are comand line open source tools you can automate them on the server where the user uploads it&#8217;s images. Now every big image can be converted to be progressive.</p>
<h3>When to use progressive and baseline JPEGs?</h3>
<p>Well the tests show that for images small than 10 K best compression you get with baseline, and for bigger images the small size you get is with progressive JPEGs. There&#8217;s the rule use the baseline for thumbs and progressive for any other big image.</p>
<h2>GIF</h2>
<p>This format is well known from the early ages of the web. It allows transparency and animation. Actually the problem with the GIF images is that they don&#8217;t support semi-transparency which is a problem nowadays. Today the web users are used to good quality images and somehow the GIF is not suitable. But it&#8217;s still the most used format for icons and of course animations.</p>
<h3>When should I use GIF?</h3>
<p>Well as I&#8217;ll mention in a while the PNG8 is a better format than GIF for transparent small icons. But if you should use some kind of an animation like ajax loading circle (or bar) the GIF format is suitable for you. Than you must use a GIF.</p>
<h2>PNG</h2>
<p>As I said PNG can be either PNG8 or PNG24 (which is also called PNG32). Actually PNG8 acts just like GIF, with the important exception that it supports semi-transparency, but yet again on every browser except IE6. In IE6 the PNG8 is just the same like GIF which is not so bad. If you&#8217;d like to use GIF for an icon, you should make it PNG8. There are semi-transparent pixels (except IE6 and above) and you get better experience on other browsers than GIF.</p>
<h3>PNG32 transparency?</h3>
<p>In fact PNG32 is not transparent on IE6 (on transparent pixels IE puts some kind of gray pixels). There you can use AlphaImageLoader filter, but that can dramaticaly slow down your browser, so it&#8217;s not a good idea.</p>
<p>You should avoid the PNG32 transparent images and the usage of AlphaImageLoader filter.</p>
<h2>Conclusion</h2>
<p>For every of these formats there lots of tools that remove system information from the image crash and crunch the files so that they become smaller. They can be automated and used on the server.</p>
<p>Now when you use different formats you can be aware of the differences between them and to use the appropriate ones.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/04/23/when-you-should-use-base64-for-images/" rel="bookmark" title="When you should use base64 for images">When you should use base64 for images </a></li>
<li><a href="/2010/01/13/optimizing-the-web-start-with-the-images/" rel="bookmark" title="Optimizing the web. Start with the images!">Optimizing the web. Start with the images! </a></li>
<li><a href="/2010/07/01/replace-the-broken-images-with-a-default-image-with-javascript/" rel="bookmark" title="Replace the Broken Images with a Default Image with JavaScript">Replace the Broken Images with a Default Image with JavaScript </a></li>
<li><a href="/2011/07/29/php-strings-how-to-get-the-extension-of-a-file/" rel="bookmark" title="PHP Strings: How to Get the Extension of a File">PHP Strings: How to Get the Extension of a File </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/04/07/optimize-your-images-improve-the-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
