类型:【转载】
原文作者:【Leo A. Notenboom】
日期:【 August 13, 2006 】
原文地址:http://ask-leo.com/blurry_images_why_do_images_on_some_web_pages_start_out_blurry_and_then_clear_up.html

 

My images are coming through ‘blurred’ when I first call them in; and only start to clear after maybe 1 or 2 seconds when they get progressively clearer until reaching the correct resolution. Do I need to download something from somewhere to enable my images to come straight in at maximum resolution?

It’s not your problem, and there’s nothing you can, or need, to do about it.In fact, in classic software parlance: it’s not a bug, it’s a feature! Let me explain why.

Jpeg image files (typically files ending in “.jpg” or more rarely “.jpeg”), can be created to display in two different ways: “Standard” or “Progressive”. When displayed, a standard jpeg will typically be drawn from the top down, one line at a time. A progressive jpeg, on the other hand, will display over the entire image area, but in several passes – each one with more detail than the last.

It’s that last type of image you’re probably seeing. And as you can probably see, it’s not something you control – whomever created the image elected to encode it this way.

The question of course is: why?

The surprising answer: bandwidth.

The question is if you’re downloading an image over a low connection (or even downloading a large image over a fairly fast connection), how soon will you realize that the image isn’t worth waiting for?

Let’s say the image is downloading and you’ve received 1/4 of the image data. For a standard jpeg, that means you’ll see roughly the top quarter of the image. For a progressive jpeg, that means you might see the entire image, but it’ll be “out of focus”.

For some images that standard format top quarter, in focus, will be enough for you to know what the rest of the image is going to be. For other images it’s not. For some images that first progressive format “out of focus” image is enough. For other images it’s not.

It’s all a matter of how much you want to see, and how quickly. Or rather, how much the image creator wants you to see, and how quickly.

The good news is that a) the size of the same image encoded either standard and progressive isn’t all that different, and b) the result when they both complete downloading is the same.

And with internet download speeds increasing all the time, the actual difference is rarely important – most images display before you even realize that they’re one or the other.

发表评论