/    Sign up×
Community /Pin to ProfileBookmark

image included in html page

I have “sunset” image in windows xp in “my pictures” folder. Size of this image is 800×600 pixels
I am including this image in my html page. When I include this image , I change the height and width

[code]
<image src=”c:shared foldermy picturessunset.jpg” width=”200px” height=”150px”>[/code]

What does this reduction in size do to the image ? Does it compress the whole image leaving the image with same amount of pixels which is 0.5 MP ? or Does it just reduce the size of the image with pixels reducing to 0.03 MP ? If it compresses the image without reducing the number of pixels, how does the rest of the pixels fit in image ?
Else, If it reduces the number of pixels, then from where the pixels are taken from the image because image still looks the same.

This question is not framed properly, because I am not very clear with the idea.
So pls explain in detail.

thanks

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@slaughtersDec 07.2009 — The images file size remains the same. The user is still downloading the same number of bytes regardless on what you set the img tags height and width to.

Visually the image is just squished down to fit. Each browser has its own way of doing this, but the simplest is that if you specify half the width and height then every other pixel of the image is displayed in the browser window (though every pixel still has to be down loaded first)
Copy linkTweet thisAlerts:
@manishrathiauthorDec 08.2009 — So does downloading the same number of bytes mean, downloading sane number of pixels ? So pixels of original file size are downloaded but only those many are displayed that can fit in the specified height and width, is that you are trying to say ? So downloading the image and displaying it are two different things ? When an image is included in a webpage, then its first downloaded on the client machine from server machine and then browser of the client machine(or is it video card) displays the image on the webpage. So client browser excludes the pixels when size is smaller. Is that how it works ?

When whole image is downloaded on the client browser, is there a way to check original size of the image downloaded ?

If height and width are halved, then every other pixel is getting omitted, does it mean that we are losing half of the pixels ? So the image contained in these pixels will also be lost, right ?

thanks
Copy linkTweet thisAlerts:
@kiwibritDec 08.2009 — The page visitor is having to down load the same-sized file. The rendered resolution is degraded. It is much better to have the correct sized image on your page in the first place. Download takes less bandwidth, and you can control (by means of your photo-editor) how the image is down-sized.
×

Success!

Help @manishrathi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...