Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: incrediBILL

Message Too Old, No Replies

Is it possible to change image resolution with HTML?

     

bubba1965

6:30 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



I know it is possible to specify the size of an image with html code. But is it possible to specify the image resolution.
I have several images that I am linking to on our webserver that are stored as 300 dpi images - I want them to display on my web page as 96 dpi.

Can I specify both the size and resolution of my existing images?

scottmack

8:21 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



>>>>> I want them to display on my web page as 96 dpi.

It doesn't matter what DPI (PPI) the image is; it will display the same on a computer screen.

>>>>>>Can I specify both the size and resolution of my existing images?

No.

encyclo

8:23 pm on Aug 11, 2005 (gmt 0)

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to the forums, bubba1965. Unfortunately, there is no way of specifying the resolution of the images in HTML. For best results, you should lower the quality and filesize of your images to ensure that they are the appropriate resolution quick to download.

bubba1965

12:59 am on Aug 12, 2005 (gmt 0)

10+ Year Member



Is it possible to do with php?

Farix

1:26 am on Aug 12, 2005 (gmt 0)

10+ Year Member



Looking through the function list for images, no.

tedster

2:41 am on Aug 12, 2005 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Note that the height and width attributes for the <img> tag are in pixels - that number is just a "mere" pixel count and has nothing to with resolution of the image. This is sometimes called an "intrinsic dimension" as opposed to the kind of height and width that are described in a css rule and NEED UNITS.

It is possible for a browser to read the pixel width and height directly from the image file itself - and if you do not define width and height attributes for the <img> element, that is exactly what will happen.

Krapulator

2:58 am on Aug 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are server-side components that can resize/resample images in this fashion on demand.

kaled

9:24 am on Aug 12, 2005 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



For bitmap images, DPI is meaningless garbage. DPI is only meaningful with respect to vector images (such as fonts and meta files) and possibly fractal images.

Use PaintShop Pro (or whatever) and rescale the images, save under another name and display those on your website.

Unless you have specific need to rescale on demand (which will use a lot of CPU power) this is the only sensible solution. Specifying the image size in html can result in extremely ugly rendering. I always remove the width and height attributes from <IMG> tags. That way if I change the native size of an image, I don't have to edit every page it appears on.

Kaled.

Dijkgraaf

5:45 am on Aug 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Kaled
DPI is relevant to Bitmap (raster images) in some situations, but just not when you are talking screen resolution I agree.
When going to print with images the DPI is a factor as usally they are specified in width and height of the image in milimeters/inches.
e.g. width (in inches) x dpi = width in pixels

Hence when you say an image is so many pixels wide, the resolution is irelevant :-)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month