Reputation:
I have a high-quality image and I want to generate img tag with this image. The problem is that it will take a lot of time to load this image. So the question is: how can I reduce image's quality without creating another one with low quality?
Upvotes: 1
Views: 317
Reputation: 253318
If you save the image, gif
or png
, with the 'interlaced' option set, it will load in progressively greater detail, initially blurred/fuzzy and increasing resolution as more data is received from the server.
This does have the principal consequence of increased file-sizes, though.
Reference:
Upvotes: 0
Reputation: 1038840
how can I reduce image's quality without creating another one with low quality?
And the answer is: you can't. If you want to reduce bandwidth you could provide thumbnails for the actual images. Those thumbnails could be dynamically generated from the original images using the server side language of your choice. If you don't reduce those images on the server, you are busted. Once you send them to the client you have already wasted the bandwidth. This reduction has to happen on the server if you want to gain something. You can always set the width
and height
attributes of the img
tag and fool yourself that you are gaining something.
Upvotes: 2