LeanImg

Does cropping an image result in a smaller file?

When we applied a 16:9 crop to our 538.6 KB photograph the file size increased to 671 KB. Cropping and adjusting the file size are separate operations, both measured using the same cropper.

The photo named texture.jpg with dimensions 3840x2160 weighs 538.6 KB. Set the online image cropper to 16:9 and then press Crop. The downloaded image remains 3840x2160 and the file size is now 671 KB. Since the original image was in the ratio 16:9, the rectangular area covered all the pixels. The version saved at quality 92 produced a JPEG that is heavier than the one you began with.

People regard the crop as if it had to reduce the size of the file since fewer pixels remain. The cut determines the rectangle and the save writes the bytes. The examples below come from our own cropper, including those which make us look worse.

Does cropping result in a smaller file size?

At times, when pixels are removed the encoder has less image to work with and a deep crop usually results in a smaller image. The encoder is still in charge of selecting the weight. The following shows four instances of the same photo being processed by our cropper using the preset aspect ratios:

Four preset ratios of texture.jpg, 538.6 KB.
RatioPixels outFile outChange
1:12160 x 2160413 KB23% smaller
4:32880 x 2160519.6 KB4% smaller
16:93840 x 2160671 KB25% larger
9:161215 x 2160259.9 KB52% smaller
LeanImg cropper result for texture.jpg at 16:9, 3840x2160 staying 3840x2160 and 538.6 KB becoming 671 KB
Result card after a 16:9 crop of texture.jpg.

When a 16:9 photo is cropped to 16:9, the file size increases from 538.6 KB to 671 KB and the quality set at 92 is higher than that of the original save.

The one that's worth looking at is the 16:9 row; zero pixels were removed from the file and its size increased by 132.4 KB. JPEG stores the image in 8 by 8 tiles. When a new encoding is carried out at a higher quality level than that of the original or on a grid which no longer matches those tiles, the file can end up being larger than the amount of pixels that have been discarded. If the aim is to keep the file small, then the crop should be sent to the image compressor. The point at which that slider ceases to be helpful on this particular photo is measured in its own section.

Does cropping have an effect on image quality?

Yes, this has happened on JPEG; JPEG, WebP and AVIF are all decoded and then reencoded at a quality level of 92. This setting is high enough to be imperceptible in a photograph yet still involves a second lossy compression. In the case of a screenshot containing a lot of small text, it is necessary to check it at 100% before using it.

Cropping a PNG is a lossless process. The pixels within the rectangle are exactly the same as the corresponding area in the original. This has been verified in the case of alpha.png: when a 1:1 crop is applied to the 900x606 file, a 606x606 PNG is produced whose RGBA values match those of the central square in the original file, and the file size decreases from 942.4 KB to 521.5 KB since 294 columns have been removed. The version of the format that retains an alpha channel is the one referred to in that rule.

A lossless JPEG crop is available in a command-line tool called jpegtran, since it only cuts at intervals of 8 or 16 pixels in order to keep the DCT blocks intact. The picture is first decoded by the browser's canvas croppers, including our own, via OffscreenCanvas.convertToBlob.

What is the difference between cropping and resizing?

Cropping discards the pixels that lie outside the rectangle and alters the composition. Resizing retains the entire image and changes its width and height.

When a face appears too small in a wide photo, crop it to a 1:1 ratio first. If the composition is already correct and the platform requires 1080x1080, then resize it. Most profile pictures require both steps, in this order, since a square that is still 2160 pixels wide is twice as wide as the Instagram feed.

The 1:1 aspect ratio is 2160x2160 and weighs 413 KB; it has the correct shape, though it is still twice as wide as a 1080 image.

LeanImg cropper result for texture.jpg at 1:1, 3840x2160 becoming 2160x2160 and 538.6 KB becoming 413 KB
Result card after a 1:1 crop of texture.jpg.

The size guide for Instagram applies to the four targets which are 1080 pixels wide. Unlike a resizer, an upscaler is a different option that is used when the crop leaves too few pixels for the print or for the screen.

May I adjust the image to a precise pixel size?

No. The cropper operates using aspect ratios and a drawn rectangle, and it does not have a width or height field. We deliberately omitted those fields since incorporating a pixel target tends to cause the output to be stretched more frequently than it results in the box that people entered.

Resize using the ratio you require and then enter the exact pixel values in the resizer. Since the ratio is already a match, that scale is clean. For custom ratios, use the two integer fields, 4 and 5, to set a 4:5 portrait.

Does cropping delete EXIF and GPS data?

Yes, the crop is carried out on a new canvas and is then encoded from scratch, meaning that no metadata from the original remains. The EXIF data, the GPS coordinates, the timestamps and the embedded thumbnail are all missing from the file you download. So is the information about the camera make and model. The orientation is applied to the pixels before the crop is made, so a phone photo with a rotation flag of 6 ends up being the right way up.

An AVIF image that is not at all cropped still ends up being rewritten. The image img.avif has dimensions of 400x269 and a size of 9.3 KB; after freeform cropping of the entire picture it returns at 21.3 KB. Once again we have the same number of pixels, a new encoding and a larger file. This is the same mechanism as with the 16:9 JPEG row. If you open the network tab while cropping you will see that it remains empty: both the decode and the encode take place within the tab. The only data that our privacy policy states we collect is the number of page views and anonymous tool-usage figures.

What is the result when I crop a GIF?

You end up with a PNG; when a GIF is decoded in the browser only the first frame is obtained, which means that anything saved with the .gif extension would in fact be a still image having an animated file name. The alteration of the file extension makes the flattening obvious. The file anim.gif reduced in size from 587.4 KB to a PNG of 115.9 KB at 320x214, consisting of one frame.

The cropper processes one image at a time, with a maximum file size of 10 MB; a crop rectangle is a choice made with regard to a single picture. Similarly, the compressor, resizer and converter each handle up to 10 images per session.