...

View Full Version : image size impact



RedLars
04-29-2011, 06:18 PM
Hi,

Say I have an image called 'logo.png' that is 200 * 200 pixel but it shall actual be shown as 150*150. How expensive is it to set the size in html (like below)? I am guessing the browser now has to resize the image before showing it to the user. Obviously another approach would be to resize the actual 'logo.png' file. Are there any guidelines regarding using width and height one images in html?



<img src="logo.png" width="150" alt="" />


Thanks for any help

Wojjie
04-29-2011, 06:25 PM
Not quite sure as to what exactly you are referring to when you say expensive.

Here are multiple drawbacks in resizing the image with HTML:

1. The extra bandwidth in hosting a 200x200 image over a 150x150

2. The browser has to resize the image, and different browsers resize differently, like I believe IE does nearest neighbor, which makes the image look strange. If you resize it yourself, you can make sure that it looks the best it can in all browsers.

RedLars
04-29-2011, 06:41 PM
Thanks for the feedback.

Sorry for being unclear, by expensive I meant the time it would take to display the image (for instance, increased cpu or memory usage or bandwidth).

amitsh
04-29-2011, 06:54 PM
resizing image inside html won't make any difference as far as loading is concerned...

resized 150x150, using width & height attributes, would take same much of time as it would to load 200x200...

d only difference would be seen in frame 150x150 will be contract as compared to 200x200...

RedLars
04-29-2011, 08:36 PM
amitsh: So you do not think the points mentioned by Wojjie are valid?

_Aerospace_Eng_
04-29-2011, 08:43 PM
resizing image inside html won't make any difference as far as loading is concerned...

resized 150x150, using width & height attributes, would take same much of time as it would to load 200x200...

d only difference would be seen in frame 150x150 will be contract as compared to 200x200...

No the file size of the resized 150x150 image would be a little less than the 200x200 photo. Over time this adds up. Will the user notice it? Probably not. Will you notice it? Maybe, depends on how much traffic you get daily.

amitsh
04-29-2011, 10:04 PM
hey red_lars

ofcourse Wojjie points are valid... showing 200x200 image as 150x150 size will add extra bandwidth to server and also secound point too

resized 150x150 by using software or resized 200x200 into 150x150 image using html will give less or extra load to bandwith... and it also not an issue to concern if u get unlimited bandwidth option from ur hosting com... :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum