Words from Alejandro U. Alvarez
Image formats review
For all of you designers out there that don't understand exactly what is the difference in "lay" terms of the most common web image formats I will go on with a little explanation and examples for you:
The background is a PNG image that is always the same, and the images are set over it
PNG
This is a relatively new file format, it stands for Portable Network Graphics, and it's primary characteristic is that it has lossless data compression, meaning that it won't lose any quality whatsoever.
And the other greatest thing about it is that it has full alpha support, meaning that it can have different opacities and transparencies.
Here are below some examples of PNG images with different backgrounds:




The size of the PNG file on top (100x50px in a row of 4) is of 12,4Kb
As you can see it can be perfectly seen even though the background is changed (stripes, solid color, alpha transparencies bg, and transparent bg)
GIF
GIF image format is probably the most common one in the web, or at least it has been for the past years. It stands for Graphics Interchange Format, and it has 3 characteristics that make it unique and sometimes useful:
- It has lossless data compression (Pretty much like PNG)
- It supports animations, although they increase a lot file size
- It supports transparencies, although it doesn't support alpha opacities.
Here is the same demonstration as before, but now with GIF graphics on top:




In order to look good GIF images with transparency often use a surrounding border, that should match the background color. As you see in the example the image looks just great when displayed over white, but when displayed over other types of background colors the transparency looks awful.
A great advantage though is that this GIF image weights 4,04Kb, against the 12Kb of the PNG file...
JPEG
JPEG stands for "Joint Photographic Experts Group" and it is not the actual name of the format, it is the name of the comitee that created it, but since everyone decided to call it this way, lets stick to it
JPEG offers some characteristics that are worth looking at when designing for web, it uses lossy compression, which basically means that when saved it will lose quality.
Depending on its use this may not be bad. For example in this site's design I've used JPEG files for backgrounds, since the quality loss contributes to the "rustic" effect, but it should never be used for logos or sharp things.
The good use for JPEG is for large photographs, big backgrounds, or other large images.
Here is an example of the dice image, using different compression quality:
Since there is no transparency the background will be seen always as white...
High quality:




Medium quality




Low quality




File sizes were:
- High quality: 31,2Kb
- Medium quality: 26,2Kb
- Low quality: 25,0Kb
Conclusion
When designing you should try to use GIFs as many times as possible, since they provide the smallest file sizes, and better quality than most JPEGs. In the cases where you need alpha transparency you should consider changing to PNGs, but avoid their use, they'll increase a lot page load time...
Have fun designing
| Print article | This entry was posted by alex on April 29, 2008 at 9:48 pm, and is filed under Cool pics, General talk, Graphic Design, Photoshop, Reviews, Web-related. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
No comments yet.
Apply a background image to an image
about 1 year ago - No comments
this is quite a neat trick, and it can look really good depending on your design and the image you put as background…
To get it to work all you need is to apply a padding and display:block; to the image. So the CSS would be:
img{
display:block;
padding:10px;
background-image:url(image.gif);
}
Here is a very smart use of this technique, where a More >
Easily assign an image to a post in WordPress
about 1 year ago - 1 comment
Have you ever wondered how to assign an image to a certain post using WordPress? Surely there are some plugins that try to do this, and maybe they accomplish it, but probably slowing down your blog.
Well, here is a way of doing it without slowing the blog or installing any sort of additional plugins. When More >
Optimizing your landing page
about 2 years ago - 4 comments
There is no need for me to prove to you that an optimization in your website’s landing page will improve your Return on Investment (ROI) and your Rate of Return (ROR). As a matter of fact it is probably one of the hardest, most over-looked, and most important parts of SEO for a website. It More >
Best Photoshop brushes for web designers
about 2 years ago - 12 comments
Here is a (huge) compilation of the best free Photoshop brushes out there. They are the ones I use, and the ones it took me a very long time to find over the web.
I’ve selected the best of them, and along with a preview and a description, I’ve made a zip file that contains the More >
PHP easy image editing:
about 2 years ago - 3 comments
Do you have a picture upload and you don’t know how to easily resize/edit the uploaded images?
Well here is a solution for php that will make your life really easy!
It is called Asido, so you may go and download their code, to follow this tutorial.
First of all I’ll suppose you already know how to upload More >
Best free icons
about 2 years ago - No comments
This is my list of the best free icon services around, all with a preview and a description
To visit just click on the title or in the image. Most of the icon sets below are both in png and ico formats, and the download page can be found within the preview page in More >
My favourite WP Plugins
about 2 years ago - No comments
After searching around for a bit for useful and good plugins, I’ve found 13 plugins that I find crucial.
And so, here is my list, they are in alphabetical order:
AddThis – Social bookmarking widget: Just scroll to the end of this post to see it in action
Adsense Manager – Put some ads here in More >