Pixel Dimensions, Document Size, and Resolution

A forum to ask questions, post setups, and generally discuss anything having to do with photomacrography and photomicroscopy.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

rjlittlefield
Site Admin
Posts: 23603
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Pixel Dimensions, Document Size, and Resolution

Post by rjlittlefield »

In this topic, an important question is asked.

It gets asked pretty often, so I thought I'd break it out as a separate topic.
BTW, "72 ppi" is not a meaningful unit for web display. That's a common spec, but at best it's a crude approximation to reality. What you have is 795 pixels wide, period. My monitor displays the image as 8.2" wide, hence about 96 pixels per inch on my monitor. In terms of the original film, it's 795 pixels in 36 mm, hence equivalent to about 560 pixels per inch scanning resolution.
What :?: :shock:
The moth wing I am about to post was photographed at 300 ppi (that's what Photoshop tells me), has a size of 4288x2848 pixels and is an horrendous 69.9 megapixels. I then change the resolution to 72ppi. I then resample to 800 pixels wide. I then "Save for Web" at quite a high quality but keeping it below 200K.
So my (Photoshop's) 72 ppi is meaningless?
Pretty much.

In Photoshop, if you pop open the Image | Image Size... dialog, you'll notice that it quotes 5 numbers:
.. Pixel Dimensions
.... Width: (pixels)
.... Height: (likewise)
.. Document Size
.... Width: (inches, cm, mm, points, picas)
.... Height: (likewise)
.. Resolution (pixels/in, pixels/cm)

The numbers shown are related to each other in a simple way:
Resolution = Pixel Dimensions / Document Size

Whenever you change one of the numbers, Photoshop automatically changes the other numbers to match.

It has a couple of different ways of doing that, depending on whether the box labeled "Resample Image" is checked or not.

If Resample Image is not checked, then the pixel dimensions are fixed and unchanging, and the rules are simple:
  • If you change the nominal Resolution, Photoshop just changes the nominal Document Size to match.
  • Likewise if you change the nominal Document Size, Photoshop changes the nominal Resolution.
Notice that I'm saying "nominal". That's the size that Photoshop would print the image, assuming that you printed it at 100%. But that size has no meaning to a browser, which just displays pixels one-for-one, or sometimes scaled down to fit the window size. (That last part depends on browser settings.)

You'll notice that changes in this mode are blindingly fast, because Photoshop doesn't have to do anything besides change a couple of numbers in the image header.

If Resample Image is checked, then the rules are a little more complicated:
  • If you change Pixel Dimensions, then Photoshop keeps Resolution fixed, and changes Document Size to match the new Pixel Dimensions.
  • If you change Document Size, then Photoshop again keeps Resolution fixed, and changes Pixel Dimensions to match.
  • If you change Resolution, then Photoshop keeps Document Size fixed, and changes Pixel Dimensions to match.
Pixel Dimensions get changed in all these cases, and you'll notice that the operations are correspondingly slower because every pixel has to be recomputed based on other pixel values in its neighborhood.

Finally, whenever you Crop an image, Photoshop keeps the Resolution fixed, and reduces the Document Size to match.

So, changing Resolution either does or does not change the pixel dimensions, depending on whether Resample Image is checked.

But in any case, Resolution never means anything more than pixel dimensions divided by nominal image size, and nominal image size (Document Size) doesn't mean anything unless you actually make a print or feed the image into some other tool that cares, such as (perhaps) a word processor.

This all sounds complicated, but it gets simple as you gradually get used to the idea that ppi and image size mean nothing in isolation, only in relation to each other, and subject to how the nominal image size is actually used.

--Rik

PS. "69.9 megapixels" isn't right. 4288x2848 is only 12.2 megapixels. Photoshop is probably telling you 69.9 megabytes -- most likely 3 bytes per pixel per layer, with a couple of layers or masks.

rjlittlefield
Site Admin
Posts: 23603
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

There's one other bit of information that you'll need when you get into text overlays in Photoshop.

Photoshop's text tool, called the Horizontal Type Tool, always specifies text size in "points", abbreviated "pt". (There are about 72 points per inch.)

The text size is interpreted with respect to the currently declared Document Size, as seen under Image | Image Size.

This makes perfect sense.

But as a practical matter, given my workflow, it makes me jump through an extra hoop.

The difficulty is that I construct standard 800-pixel-wide images by cropping some arbitrary number of pixels and then resizing using Image | Image Size. Photoshop implements the resize in such a way that all my 800-pixel wide images end up with different Document Sizes.

To be specific, my camera generates images that have Pixel Dimensions 3072x2048 and Document Size of 17.067 x 11.378 inches (433.5 x 289 mm). If I simply crop to actual pixels, 800x533, then the Document Size becomes 4.444 x 2.961 inches. A text overlay of any fixed size, say 9 pt, may be much too small for the former, and much too large for the latter. Crops of other Pixel Dimensions yield other Document Sizes, with corresponding effects on text overlays.

The solution to this difficulty is to resize images in two steps. First, I resize to 800 pixels with Resample Image checked. Then I uncheck Resample Image, and resize the image again to have Document Size of 7 inches along the 800-pixel axis. After this pair of resize operations, the image is both 800 pixels and a standard Document Size, and I know that a text layer of specific size (so many points) will always produce the same result.

I hope this is helpful. Sometimes the little details can be big problems!

--Rik

puzzledpaul
Posts: 414
Joined: Sun Aug 06, 2006 4:15 am
Location: UK
Contact:

Post by puzzledpaul »

<< always specifies text size in "points" >>

Assuming you're using a more recent version of p/shop than myself, has this changed, then ... since there's also a pixels option available in 5.5?

pp

rjlittlefield
Site Admin
Posts: 23603
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

pp, thanks for that pointer!

I'm using version 8.0, "Photoshop CS". There's nothing in the Horizontal Type toolbar that says "pixels" or hints that the units can be changed.

However, when I dug deeply enough into the Help system, I eventually found this explanation:
In Photoshop, the default unit of measurement for type is points. One PostScript point is equal to 1/72 of an inch in a 72-ppi image; however, you can switch between using the PostScript and traditional definitions of point size. You can change the default unit of measurement for type in the Units & Rulers area of the Preferences dialog box.

To choose a type size:

In the Character palette or options bar, enter or select a new value for Size . In Photoshop, to use an alternate unit of measurement, enter the unit (in, cm, mm, pt, px, or pica) after the value in the Size text box. The value you enter is converted to the default unit of measurement.
No doubt it'll take a bit of getting used to, but this should simplify my life. Thanks! :D

--Rik

Charles Krebs
Posts: 5865
Joined: Tue Aug 01, 2006 8:02 pm
Location: Issaquah, WA USA
Contact:

Post by Charles Krebs »

Rik,
The solution to this difficulty is to resize images in two steps. First, I resize to 800 pixels with Resample Image checked. Then I uncheck Resample Image, and resize the image again to have Document Size of 7 inches along the 800-pixel axis. After this pair of resize operations, the image is both 800 pixels and a standard Document Size, and I know that a text layer of specific size (so many points) will always produce the same result.
I'm a little confused... when you resample the first time, why not just first enter 114 ppi in the "Document size" "Resolution" box, and 800 pixels wide in the upper "Pixel Dimensions" box . Then you have your "standard" 7 inch wide/800 pixels wide image in one operation.

rjlittlefield
Site Admin
Posts: 23603
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Charles Krebs wrote:...when you resample the first time, why not just first enter 114 ppi in the "Document size" "Resolution" box, and 800 pixels wide in the upper "Pixel Dimensions" box . Then you have your "standard" 7 inch wide/800 pixels wide image in one operation.
Probably because I never thought to use that particular sequence. At one point, I got pretty confused by Photoshop's mode-dependent style of "you change that, I'll change this -- or maybe this other thing", so I broke down the operation into one sequence that I found easy to understand, and stuck with it.

It seems there's a better way -- yours.

Looking over Photoshop's rules that I wrote above, it's quite straightforward. When you enter Resolution first, Photoshop changes Pixel Dimensions to some typically useless value. Then when you enter Pixel Dimensions, Photoshop leaves Resolution alone and changes Document Size to what is now the correct value.

I find it interesting to think about the two procedures from the standpoint of explaining and adapting them.

In the procedure that I described, the two key parameters of Pixel Dimensions and Document Size get plugged in directly. If somebody wants to use different numbers -- say to produce a file that is 750 pixels wide for Internet use and also prints at 6 inches wide, all that's required is to type 750 and 6 into the proper boxes, while pushing the buttons in the correct order.

In the procedure that you describe, only one of the key parameters gets plugged in directly. The other one has to be computed beforehand. If somebody wants 750 pixels and 6 inches, they still have to push the buttons in the correct order, and in addition, they have to divide 750 by 6 to get a resolution of, um, oh dang, where is that calculator? (I'm not joking -- I have actually watched students haul out cell phones to evaluate 120/20.)

Thinking about this more, I really like how your strategy optimizes a standard workflow.

But if I have to explain the procedure to somebody who doesn't already think in terms of pixels per length, maybe I prefer the one I described. :?

BTW, after typing this, I actually tried your procedure. When I was done, the Document Size was not exactly 7 inches, but rather 7.018 . Of course if I wanted it to be exactly 7 inches, I could have typed in 114.286 pixels/inch. But that's calculator material even for me -- except I didn't have to use a calculator to get the number, it fell out of the Photoshop procedure that I described.

Interesting discussion! I had not thought about this in detail before.

--Rik

Post Reply Previous topicNext topic