Msg#: 10808 posted 6:30 pm on Aug 11, 2005 (gmt 0)
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?
Msg#: 10808 posted 8:23 pm on Aug 11, 2005 (gmt 0)
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.
Msg#: 10808 posted 2:41 am on Aug 12, 2005 (gmt 0)
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.
Msg#: 10808 posted 9:24 am on Aug 12, 2005 (gmt 0)
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.
Msg#: 10808 posted 5:45 am on Aug 13, 2005 (gmt 0)
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 :-)