Link to home
Start Free TrialLog in
Avatar of steva
steva

asked on

Image loading

I have a page with links to a lot of images.  I notice that when you click the image links some images paint from top to bottom, and others appear all at once but blurry, and then a half second later the image corrects to full resolution.

I wondering what controls the way the image loads and if I have any say about it.

Thanks
Avatar of plusone3055
plusone3055
Flag of United States of America image

you dont really have any say about it.. the images loads by types and  IE JPG, GIF, ect ect and more importantly SIZE .. If you want ot have "control" ocer the resize them to the same size then it will load faster  
for the best consistency use Jpg Files
If they are large  
You maybe can do a javascript preload of the images,
or use a javascript as lightbox
http://www.lokeshdhakar.com/projects/lightbox2/
Avatar of steva
steva

ASKER

Thanks for the input but that doesn't really answer my question.  I know if I preload images they'll snap in place, but the question is, when you don't preload them (there may not be time to  preload before the image is requested)  what causes some images to load in a two-step process ( blurry, then clear)  and others to scan themselves in?

Thanks
that's depends of how the web browser renders the images.
please tellme the web browser you are testing, and if in all these the results are the same
Avatar of steva

ASKER

I was using Firefox, and it renders some images the blurry/clear way and others it scans in.  IE and Chrome seem to always show black until  the image is loaded and then they show the image all at once.

Looking closer, it seems that images that are around 1MByte get the blurry/clear treatment in Firefox while the images that get scanned in are all over 2.8MB.  So I guess Firefox decides how to display  the image depending on the image's size, while the other browsers show you nothing until they have all of the image.  Actually, the other browsers show you nothing until they have about 1MB and then they show you that.  So for them,  the 2.8MB image appears in three progressive steps. Firefox, when it scans the image in, seems to read a small amount, maybe 50KBytes, displays that, reads another 50KB, etc.





ASKER CERTIFIED SOLUTION
Avatar of wmadrid1
wmadrid1
Flag of Colombia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of steva

ASKER

Ajax is a great idea!  In my web development I keep going up to doors marked "AJAX" but then I find another way to do it instead of going through the door.  And here I am again.  Sooner or later I know I need to add AJAX to my toolbox and your code and reference is a great way to start.  Thanks.

I'll give you the points.

By the way, this is a little off topic, but you seem to have some experience with images, so I thought I would throw it out and see what your thougts are.  I know it's recommended that you resize images before you download them to a browser because external programs (e.g., IrfanView) do a better job of resizing than browsers do, plus, if you resize beforehand you benefit from a smaller load and less processing time spent in the browser.  BUT,  if you've built a fluid websit, such that when you resize the page the images and divs all shrink or grow  proportionately, the image gets resized anyway by the browser.  And when you resize a resized image I find that the result is not as crisp as when you just resize once. So I'm thinking that if you want to end up with  the crispest image and you have a fluid page design, you should not resize first, but download the larger original image and let the browser resize it just once.  Any thoughts?

Thanks for your help.
I am not an expert on images.
When working with web apps, we depend of web browsers. Also we can make some framework to try manage the images, dowloading them in background, but always will be some problem in some web browser.

I can recommend you try the AJAX with JQuery
http://jquery.com/
It's free and can help you with the javascript and AJAX easy use, also have some interesting plugins .
Avatar of steva

ASKER

Thanks.