tags:

views:

64

answers:

4

hi guys, i notice lately that in some websites (i think wired.com does it) the image first load really fast .it always start blurred and get better and finally you have a really hi-resolution picture which is really tiny in size. my question is 1. what is going on????!!! 2. how do i incorporate it into my work?

i was thinking it have to be javascript doing something to some raw image data sent asynchronously.

+4  A: 

It's called "interlacing" and is a feature of JPG and PNG file formats. GIF also supports it, albeit not so well.

It really depends on how you save your images. Most decent image editors will have a checkbox which allows you to specify whether to produce interlaced or non-interlaced images. Some (like Photoshop) even allow you to specify how many passes to do for a JPG file.

The idea behind the feature is exactly this - so that you would get a picture over the wire as fast as possible. It would be blurry at first, but you would at least have something. The finer details would come later.

Interlaced pictures are a little bit larger than non-interlaced pictures with the same content.

Added: In laymans terms, think of it like this - instead of one picture, the JPG file will contain three - small one, medium, and full size. At first the small one is downloaded and then displayed really stretched. Then the medium one gives more details (but is still stretched), and finally the full picture arrives. There can be more than 3 pictures as well.

Vilx-
interlacing please explain?
Spikie
http://en.wikipedia.org/wiki/Interlace_(bitmaps)
Cory Petosky
ok... well explain too.this may be crazy but i was just wondering !!! how about a case i have a store in a database.some ugly chunk uploaded by a user i want to put it into some nice, light,Interlaced way using the server before serving it up to the browser????
Spikie
ok... well explain too.this may be crazy but i was just wondering !!! how about a case i have a picture stored in a database.some ugly chunk uploaded by a user i want to put it into some nice, light,Interlaced way using the server before serving it up to the browser????
Spikie
You would need a server side application to load image (Usually, but not unheard of, it is not stored as binary in database, but as a file with path to it provided inside database), and then save it back as interlaced.Usual server side libraries you use in order to program this are: [GD Library][http://www.libgd.org/Main_Page] or [ImageMagick][http://www.imagemagick.org], [PIL][http://www.pythonware.com/products/pil/]. However, there is plenty of choices out there for various languages. It is up to you to pick one you like the most.
Krule
+1  A: 

That's just a progressive JPEG or PNG image -- any decent image editor can save out in this format.

Cory Petosky
+1  A: 

This is called an "interlaced" gif, or "progressive" jpeg. It's the way the image file is saved - the image uses a bit more space, but it start loading really fast.

You can use your image editor to save your image this way. With imagemagick, do

convert -interlace PLANE input.jpg output.jpg
gnud
+1  A: 

Check the options when you save a JPEG file in your image editor (Photoshop, GIMP, etc). There should be an option for "interlaced" or "progressive" format.

Wikipedia explains it well, as usual.

DisgruntledGoat