bbc / Imager.js

Responsive images while we wait for srcset to finish cooking
Apache License 2.0
3.84k stars 224 forks source link

Progressive quality of images #6

Closed bartzon closed 11 years ago

bartzon commented 11 years ago

For one of the websites I'm working on, I've built a similar but slightly different image loader. For larger images, it first loads an image at 10% quality, then keeps doubling that quality until the full version (100%) is loaded. It tacks the quality at the end of the filename, eg my_big_image@10.jpg, my_big_image@20.jpg and so on. Would you be interested in a pull request which implements this?

bartzon commented 11 years ago

An example can be found at http://www.uitzendinggemist.nl/programmas/975-nieuwsuur

jonlow commented 11 years ago

Hey @bartzon. Interesting loader implimentation, but what it is the benefit of it? It seems like a lot of extra requests and image weight to me. Imager.js was built to avoid requests and minimise image weight.

bartzon commented 11 years ago

The example page is, as you can see, very heavy on images. Since it's one site accessed from all over the world (without geolocated cdns and the like) where uplinks might be slow, we need to display images as soon as possible. Also, we don't control the filesize of the big header image, so this can potentially be many kbs.

Yes, this'd be some extra requests (10,20,40,80,100, 5 requests), but the next quality would only be requested when the image has fully loaded. I understand your requirements are a bit different than ours :)

Integralist commented 11 years ago

Hi @bartzon thanks for opening up this discussion, but as mentioned by @jonlow we're very keen on performance and to also avoid any unnecessary HTTP requests. So because of this I'm going to close this issue, but do feel free to keep the discussion going if you believe there is some details/benefits we've not considered.

bartzon commented 11 years ago

No problemo :). Looking forward to where this lib is heading.