Archived posting to the Leica Users Group, 2002/10/27

[Author Prev] [Author Next] [Thread Prev] [Thread Next] [Author Index] [Topic Index] [Home] [Search]

Subject: Re: [Leica] Re: web sizing images
From: Brian Reid <reid@mejac.palo-alto.ca.us>
Date: Sun, 27 Oct 2002 13:30:38 -0800
References: <LNBBLBNFHNEHGFKFMALGIEOECPAB.tim@KairosPhoto.com> <5.1.1.6.0.20021027094825.00b1c8c8@mail.msy.bellsouth.net> <003f01c27ddd$ae7bd270$64efcd18@clearsighjhm83> <3DBC4DCB.3080305@webshuttle.ch>

This is a terribly complex subject but it has a simple answer for the web.

Here are some random disconnected facts, which together answer most of these questions.

* Most software that displays images on computer screens pays no attention to the "pixels per inch" indication in the image. It just shows the pixels. If an image is 100 by 200 pixels, then it will occupy 100 by 200 pixels on the screen, reguardless of the pixels-per-inch figure specified in the image itself.

* Glass (CRT) monitors are configured in software to show a certain number of pixels. Not every screen can show every configuration. Small cheap screens these days are usualy limited to perhaps 1280 pixels wide by 960 pixels high, but you can go into the control panels and change it, to within the performance limits of your hardware.

* Flat-panel (LCD) monitors have the pixel spacing built in at the time of manufacture. If an LCD is manufactured to have 1280 by 960 pixels, then that is how many it has. If you ask your software to convert to a different number of pixels, it will do it either by using a smaller portion of the screen, or by converting from one pixel resolution to another inside the electronics, which can look very bad.

* The conversion from one pixel resolution to another is called "resampling", and it is very difficult to do well. It is easy to do badly. If you start with an image that is 2000 by 1600 pixels and change it to be 1000 by 800 pixels, that is pretty easy; you just convert 2 for 1 in each dimension, possibly by averaging and possibly by throwing away every second pixel.  Resampling a picture from 1000x800 into 700x560 causes each pixel in the new image to be recomputed as a function of some of the pixels in the old image.

When software is resampling an image, the more "input" pixels it can consider while computing each "output" pixel in the scaled image, the better a job it can do. High-end software like Photoshop can look at 25 to 50 pixels in the source image while computing one pixel in the scaled image.


Taking all of this into account, here is my answer to the original question:

1. Make sure that *you* are scaling the image, not some browser or monitor. Be absolutely certain that the web page that you produce specifies the actual size of the image. Do not use a program like Front Page (or, for that matter, any other Microsoft product) to scale the image.

2. When you are using an image editing program to scale an image, make sure that you are using as many bits per pixel (or "per channel") as that program will allow you to use. Never try to scale or resample an indexed image; always use an RGB image.

3. Avoid scaling by amounts that are very nearly equal to the ratio of small integers. For example, it is fine to scale by exactly 50%, but scaling by 51% or 49% can lead to visual imperfections in some software. By "the ratio of small integers" I mean that if you are going to get near something like 1/2, 2/3, 3/4, 3/5, or whatever, make sure that you use exactly that value and not approximately that value.

9 times out of 10 when you are having an image scaling problem, it is caused by not paying attention to (1) above: make sure *you* are scaling the image, not the browser or hardware.
 
- --
To unsubscribe, see http://mejac.palo-alto.ca.us/leica-users/unsub.html

Replies: Reply from "Jim Laurel" <jplaurel@nwlink.com> (Re: [Leica] Re: web sizing images)
In reply to: Message from "Tim Atherton" <tim@KairosPhoto.com> (web sizing images (was RE: [Leica] Kodak Royal Gold 100))
Message from "Jeffery L. Smith" <jsmith45@bellsouth.net> (Re: web sizing images (was RE: [Leica] Kodak Royal Gold 100))
Message from "Joseph Codispoti" <joecodi@clearsightusa.com> ([Leica] Re: web sizing images)
Message from Nathan Wajsman <wajsman@webshuttle.ch> (Re: [Leica] Re: web sizing images)