Measuring the Size of Your Photo

Before we discuss the correct size for photos intended for the Web, here's a quick refresher on how to measure the size of your photo.

The size of digital pictures can be described in three different ways:

■ The pixels per inch (ppi), which is often also referred to as dots per inch (dpi), plus the actual dimensions of the picture, such as 3"x5". When measuring a photo using this scale, you must have both elements—how much data are in each inch and how many inches there are.

■ The dimension of the photo stated in pixels. This is the result of simple arithmetic applied to the above description. You take the ppi number and multiply it by the inches in each dimension. Therefore, a 3"x5", 300 ppi photo can also be described as 900 x 1500 pixels.

■ The total file size, such as 6MB (megabytes) or 200K (kilobytes), in which kilobytes are smaller than megabytes. (1,024 bytes equal 1K, and 1,024K equal 1MB.)

If you really want to know how megabytes are related to pixels (and if your eyes don't glaze over when numbers and formulas are discussed, here we go ... . Multiply the measurement of the two dimensions in pixels (900 x 1500 in the preceding example), multiply the result by 3 (for the three primary colors of RGB: red, green, and blue), divide by 1 million (or if you want to be precise, divide by 1,048,576, which is 1024 x 1024), and then add a little bit extra for the overhead data that are always attached to the picture information, especially the metadata. Therefore, in the preceding example of a 900 x 1500 pixel photo, the file will be approximately 4MB—if it is uncompressed. (Please see Chapter 5 regarding the JPEG file format and metadata, and this chapter's section on "Optimizing for the Web" for discussions of compression.)

(Width in pixels x height in pixels x 3) / 1,048,576 = megabytes

Technophiles will note that the formula for the image size in megabytes (before adding the overhead data) is actually the one used for determining the number of megapixels on an image sensor. That's because pixels are a type of byte, being the smallest piece of data that defines a digital photo. (See Chapter 1.)

0 0

Post a comment