Resizing and Resampling

Image Resizing And Resampling — It’s Not The Same Thing

Vincent T.
High-Definition Pro
9 min readNov 9, 2020

--

When working with digital images, there are plenty of manipulation techniques we can apply. A photographer can edit photos captured from an SD card during post and further retouch the images. One important detail is the size of the image, also called the resolution.

The resolution is measured in pixels along the width (w) and height (h) of an image. You can change the size of an image by resizing and resampling. Resampling involves resizing, but resizing is not exactly resampling. The two techniques are not the same though the term itself is used interchangeably at times.

The total size of an image is (in resolution R) the width multiplied by the height (or vice versa depending on the orientation):

R = w * h

Altering its size thus involves a reduction in the number of pixels. The first technique would involve a simple method like in resizing, but the second would be more complex like in resampling.

The process of resizing or resampling does not take place during image capture. When a photographer captures the image, their camera’s sensor uses the native resolution. A 32 MP camera is thus capable of using the full native resolution when capturing an image. It is in post or when the image has been transferred from the camera to a computer when its size can be modified.

Cropping

Before continuing, it is best to touch on another technique called cropping. The quickest way to alter the size of an image is by cropping. When you crop the image you are reducing the amount of pixels to fit a certain boundary. This is similar to the way you cut out the edges along a photograph with a scissor so it can fit inside a collage.

In digital imaging, cropping cuts a portion of an image out to create a new image. The new image is smaller in size due to the cropping since portions of the image were removed. Cropping is often used in applications for profile photos or headshots.

You can select an area in image to crop and then copy/paste it to create a new image

When using image editing like Adobe Photoshop, a marquee tool can be used to crop the image. When a certain part of the image is selected, the rest can be discarded. This reduces the image size, but keeps the part of the image that the photographer wants.

Another way to resize an image is to change the size around the borders, also called the canvas size. If the most interesting part of the image were in the center of the frame, the canvas can trim off areas around the frame that are not significant to the image.

In portraits, cropping can select certain parts that make the image more intricate

In cropping, it is like you are taking only a certain area within an image by 4 coordinates on a plane (a, b, c, d). You then subtract the rest of the image from that selection. It takes the pixels from the selected area (A’) and subtracts that from the total area (A) at the specified coordinates.

Cropping = A - A' Where:A > A' (small crop) OrA < A' (big crop)

Cropping does not alter the image in the same way as resizing or resampling. It is merely a process of cut or copy and pasting it to create a new image. While the size changes, it doesn’t keep the original image. This is because when you are cropping, you are taking only parts of the image. Resizing and resampling involve keeping the whole image intact.

Resizing

Perhaps it is when it comes to print sizes where resizing matters most. When you want to change the size of the image, but not the number of pixels, it is considered resizing. This is mostly used when printing an image for publication on paper or other material. Changing the size of an image without changing the number of pixels is information needed by a print driver to send a print job to a printer.

High resolution image for printing to 8.5" x 11" (Letter Size) paper

The size of an image, when resized, refers to its physical size. It will no longer be measured in pixels, since the output is not for a digital display but to a material (e.g. paper). The dimensions, now in the physical space, are measured in length (L) and width (W). Height (H) would make up a third dimension unit when in the physical space and gives the volume of an object (e.g. L * W * H).

The units are in inches (in) or centimeters (cm) and can be converted to other units. Larger printers can even use feet (ft) or meters (m) as the unit of measurement. The pixel density will thus be in pixels per inch (PPI). The input is still digital since it is stored in a computer, but the output is analog to paper. Image dimensions are measured differently which is why it will be relative to the paper size.

There are different print formats available to choose from (depending on the software used). Certain images can be printed on standard copy paper at 8.5" x 11" (Letter Size) and for photos 4" x 6". The number of pixels is not fixed for any of these sizes, that can be specified. You can resize the image to print using any resolution in pixels. That means a 4288 x 2848 image can maintain its pixel resolution while changing its print size to any format.

The greater the resolution, usually the better the print quality but it is more about the quality of the printer as well. In printing terms, the pixels would be akin to dots measured in dots per inch (DPI).

When the image is resized, its dimension is converted from digital to a physical format. For example a 4288 x 2848 image is translated from pixels to dots when it is sent as a print job to the printer. Assuming we are printing it to 8.5" x 11" copy paper. To find the pixel density in DPI:

D1 = Diagonal of Paper (Measured in Dots)
D2 = Diagonal of Paper (Measured in Inches)
DPI = D1 / D2D1 = 5147 dots
D2 = 13.9 in
DPI = 5147 / 13.9 = 370

For every inch, there are 370 dots on an 8.5" x 11" copy paper. Larger prints can have as high as 4800 dpi, but that would require resizing the physical dimensions to allow the image to fit on the material without changing the resolution in pixels.

You can also find the dimension of the horizontal or vertical size with the correct aspect ratio given the DPI value. To find the horizontal dimension or width in pixels of a 36 x 24 mm print from an image resolution of 1920 x 1080 pixels in the correct aspect ratio:

DPI = 1143
w = 36 mm
x = 1 inch = 2.54 mm
P = (DPI * w) / x
P = 1143 * 36 / 25.4 = 1620

Supposed we have a 4928 x 3264 pixel image (16 MP) that we want to output to a large print. The software has a 300 DPI capability to print the image to a poster size paper. To find out how big the print’s physical dimensions will be (L x W) :

L = 4928
W = 3264
DPI = 300
Calculate the Length (also referred to as Width in pixels):
L = 4928 * 1 inch / 300 = 16.42
Calculate the Width (also referred to as the Height in pixels):
W = 3264 * 1 inch / 300 = 10.88

We can vary the size by the DPI without changing the pixels. The image can still remain at 4928 x 3264 pixels, but the DPI can be changed to 100 to get a resized print:

L = 4928 * 1 inch / 100 = 49.28
W = 3264 * 1 inch / 100 = 32.64

For larger prints, pixel density does not have to be too tight. 100 DPI is quite acceptable compared to 300 DPI because most large prints are viewed from a far distance (e.g. billboards, posters, banners). 300 DPI would be more ideal for smaller prints like business cards or comp cards where the tighter placement of pixels give a more detailed and solid look.

Let’s now take these calculations and apply it with a real world example. If I have 4928 x 3264 image resolution and I want to print it on 8.5" x 11" copy paper (Letter Size) in landscape orientation (11" x 8.5"), what DPI setting would be the best choice?

We see from the previous example that 300 DPI would be printable to 16.42" x 10.88" image size. It is far to big to print to paper. If we resize it using 450 DPI, we get 10.95" while 600 DPI is 8.21". 450 to 480 DPI range would fit the image to the 11" length of the paper.

Resampling

Resampling actually does change the size of an image, in terms of its resolution. It is a form of resizing so to speak, but uses a technique called interpolation in order to keep the image intact without cropping involved. When an image is resampled, it uses interpolation by using known data to estimate values at unknown points to create pixels. When an image is upscaled (upsampling), more pixels are added to the image resolution while in a downscaled (downsampling) image there are less pixels.

Basic interpolation equation

When an image is resized, it can be resampled using editing software. While you can resample an image, it doesn’t always maintain the quality in the image. It is usually best practice to downscale from a higher resolution to a lower resolution image. This is because since there are plenty of details from a high resolution image, when downscaled it still preserves some (not all) of those details which is better quality. When upscaling an image, you don’t get the same quality since you cannot create additional details to the image since it doesn’t exist.

Upscale3264 * 4928 -> 6528 * 9856Downscale7680 * 4320 -> 3840 * 2160

AI enhanced resampling is changing the way details can be preserved or even created. Neural network processing can upscale an image and create new details that were not possible using interpolation techniques. This allows the image to maintain its quality and not just adding pixels to the image. Such techniques, called superscaling, can upscale an image 2x or more and still maintain a high level of quality.

In downscaling, the number of pixels are reduced

Synopsis

When keeping the number of pixels in the image the same and changing the size at which the image will print, that’s known as resizing. If physically changing the number of pixels in the image, it is called resampling. While both techniques do change the image’s size, they do so in a different manner and purpose.

Resizing can maintain the highest level of quality in an image, which is important when printing. Higher resolution images to print will appear with better results than with lower resolution images. Resampling tends to degrade the quality when upscaling, but not with downscaling. AI techniques help improve upscaling by using machine learning methods with neural networks (e.g. CNN).

Although the terms are used quite often interchangeably, the actual methods involved in the techniques are different. You can resize an image by resampling, but you do not resample an image by resizing when you print.

In fact, resolution can be preserved (no resampling) when resizing. It is frequent to hear someone say they will resize an image when they are actually resampling an image. It is better to understand in terms of how it is used in production, where resizing refers more to the print size while resampling refers to changing resolution.

--

--

Vincent T.
High-Definition Pro

Blockchain, AI, DevOps, Cybersecurity, Software Development, Engineering, Photography, Technology