Image Size

(Scale and Rotate)

The size of the image (number of pixels on an edge) and the aspect ratio (height/width) can be changed with the Edit->Scale and Rotate (in ImageJ: Image / Scale and Image / Rotate / Arbitrarily) ... menu.

Difference between Zoom and Scale and Rotate...

The zoom tool uses the screen drawing/graphics tools of the computer to replicate pixels so that each pixel of the image corresponds to a square of pixels on the screen. The Edit -> Scale and Rotate... menu replicates the pixels making a new larger image - where each pixel is visualized by only one pixel on the screen. This example uses the very small ramp image used in the first exercies for an exaggerated case in point...

We will use two copies of the s255.tiff image: a zoomed one on the left, and a magnified version on the right.

Two copies of the same image are now open.

Now the two images look identical, however, as far as image processing is concerned, they are not.

 This is the Zoomed image. The title bar is the name of the file.

 This is the enlarged copy. It remains 'Untitled' until it is saved to a file. We will not save it.

One obvious difference between the two images is that they (the image data arrays) are different sizes. The one on the left is 16x16, and the one on the right is (16x16) x (16x16) or 256x256. I don't know of any way of directly showing the image sizes, as in Adobe Photoshop, but moving the cursor over each window will show the X and Y coordinates, which are different in each case.

ImageJ shows the image sizes directly:


Another difference due to the sizes of the image data arrays becomes apparent when an area of the image is selected.

The selection is shown in both images by a one pixel wide border of 'crawling ants', plus a4x4 pixel area in the lower right by which the selection may be enlarged by dragging. (If any other part of the outline is dragged with the mouse, the selection is moved but not changed in size.

 Since the small image has been zoomed so much, individual pixels are quite broad (16 pixels here).

In ImageJ, the yellow selection rectangle appears normally, but the handles will 'jump' from line to line reflecting the small number of pixels actually in the image.

 This selection appears more 'normal'.


More differences appear when applying various image processing operations. At this point, you might want to save the "Untitled" image, because these operations will not be 'undoable' once the other image is clicked on.

Process -> Find Edges

This shows the result of a Sobel edge detector on the images. This is a 3x3 pixel operator that gives a result proportionate to the change in pixel intensity from one side to the other of the 3x3 window. The window is scanned over evey pixel in the image except for a 1 pixel wide border.

 This image is all edge, because each pixel differs from its neighbors by the same amount in the x direction and in the y direction. The border, one pixel wide, was ignored by the operation, and just duplicated here in the result.  The rows differ from their upper and lower neighbors by 16 intensity units, and the collumns differ from theirs by one intensity unit. That is why the vertical edges are very weak.

Optional Exercise

Many of the image processing operations, the smoothing ones in particular (mean filter, median filter) do not show much if any difference between the two images, because they have very little effect on these particular images. One operation that does shows some effect on the magnified image on the right, but not on the small original, is the Process -> Sharpen command.

 Since this image (the data array, not as displayed) is a continuous ramp, the sharpen operation has no edges to sharpen. The filter distinguishes between flat areas of the image and areas where there are abrupt changes in intensity levels.  The horizontal edges are enhanced in this image, because the image array in fact does have flat areas (bands of uniform intensity or pixel value from duplicating pixels) with jumps in intensity at the edges of the bands, which were formerly just rows one pixel wide.