Image Cropper

Crop a photo by dragging a rectangle over the part you want to keep. Preview the crop and download it, all in your browser.

Drop an image here or tap to choose

Your image is processed in your browser and never uploaded.

About Image Cropper

This Image Cropper provides a client-side utility for performing destructive image cropping. Cropping is a fundamental operation in image editing[11] that involves removing the outer parts of an image to improve framing, accentuate subject matter, or change its aspect ratio. The process is a form of clipping[5], a core concept in computer graphics where geometric elements are discarded outside a defined boundary, in this case, a rectangular clipping window. Unlike image scaling[12] or resampling, which alters the entire image by interpolating pixel values, cropping simply redefines the image's dimensions by discarding all pixel data outside the selected region. This tool leverages the browser's native Canvas API[4] and JavaScript[14] to perform these calculations locally, ensuring user privacy as no data is transmitted to a server.

The implications of cropping vary significantly depending on the image file format's underlying data structure and compression scheme. For uncompressed or losslessly compressed formats like BMP[3], TIFF[21], and PNG[16], cropping is a lossless operation. It involves rewriting the file header with new dimensions and discarding the pixel data from the cropped areas without re-encoding the remaining pixels. This preserves the original image quality of the selected area perfectly. The operation is mathematically straightforward, adjusting the pointers and dimensions of the pixel data matrix.

In contrast, for lossy formats like JPEG[15], standard cropping is inherently a lossy process. A JPEG image is not stored as a simple grid of pixels but as a compressed representation based on the Discrete Cosine Transform[6] (DCT) applied to 8x8 or 16x16 pixel blocks. To crop a JPEG, the image must be fully decompressed into a pixel bitmap, the crop operation is performed, and then the resulting image is recompressed. This recompression step introduces new quantization errors, leading to a form of generation loss[9], even if the quality setting is high. Specialized lossless JPEG cropping utilities exist that can perform the operation by directly manipulating the DCT blocks without full decompression, but this requires complex block-level realignment and is not typically supported by general-purpose browser APIs.

Modern digital images often contain extensive metadata embedded within the file, structured according to standards like Exif[7] (Exchangeable image file format), IPTC[13] (Information Interchange Model), and XMP[8] (Extensible Metadata Platform). This metadata can include camera settings, GPS coordinates, and image orientation. When an image is processed using the HTML Canvas API, as in this tool, this metadata is typically stripped from the output file. The primary reasons are security, privacy, and the simplification of the file-writing process. The resulting cropped image is a new bitmap representation of the selected pixels, rendered in the sRGB[20] color space, without the metadata payload of the original file.

How to Use

  1. Select or drag and drop an image file from your local device into the tool's input area.
  2. Click and drag a rectangle over the preview to define the initial crop area.
  3. Refine the selection by dragging the corners or edges of the crop box.
  4. Optionally, enforce a specific aspect ratio[2] like 1:1 (square), 4:3, or 16:9 using the provided controls.
  5. Press the 'Crop Image' button to execute the clipping operation on the image.
  6. Download the resulting cropped image file to your computer.

Frequently Asked Questions

Is the cropping process on this tool lossless?

It depends on the output format. For formats like PNG[16], the operation is lossless. For JPEG[15] files, this tool must decompress, crop, and then recompress the image, which introduces a small amount of quality degradation known as generation loss[9] due to the re-quantization of DCT[6] coefficients.

Are my images uploaded to your server?

No. All processing is performed locally in your web browser using JavaScript[14] and the HTML5 Canvas API[4]. Your images never leave your computer, ensuring complete data privacy.

Will the original image's metadata (Exif, IPTC) be preserved?

No. When an image is drawn to and exported from an HTML canvas, its associated metadata like Exif[7], IPTC[13], and XMP[8] is not transferred to the new file. The output is a new image containing only the pixel data.

What is the difference between cropping and resizing?

Cropping removes unwanted outer areas of an image, changing its dimensions and potentially its aspect ratio. Resizing, or image scaling[12], changes the pixel dimensions of the entire image through resampling[18] algorithms, stretching or shrinking the image content without discarding any of it.

How can I use cropping to apply the rule of thirds?

The rule of thirds[19] is a compositional guideline. You can use this tool to reframe your photo, aligning key subjects with the imaginary gridlines or their intersections to create a more compelling composition after the photo has been taken.

What color space is used for the output image?

Web browsers and the Canvas API operate almost exclusively in the sRGB[20] color space. If your source image uses a wider gamut profile like Adobe RGB[1] or ProPhoto RGB[17], its colors will be mapped to the sRGB gamut during processing, which may result in a minor shift in color appearance.

Can I crop an animated GIF or WebP file?

No. This tool is designed for static images. Cropping animated formats like GIF[10] requires each frame of the animation to be cropped individually and then reassembled into a new animated file, a process which is significantly more complex and not supported here.

Sources (21)
  1. Wikipedia: Adobe RGB color space
  2. Wikipedia: Aspect ratio (image)
  3. Wikipedia: BMP file format
  4. Wikipedia: Canvas element
  5. Wikipedia: Clipping (computer graphics)
  6. Wikipedia: Discrete cosine transform
  7. Wikipedia: Exif
  8. Wikipedia: Extensible Metadata Platform
  9. Wikipedia: Generation loss
  10. Wikipedia: GIF
  11. Wikipedia: Image editing
  12. Wikipedia: Image scaling
  13. Wikipedia: IPTC Information Interchange Model
  14. Wikipedia: JavaScript
  15. Wikipedia: JPEG
  16. Wikipedia: PNG
  17. Wikipedia: ProPhoto RGB color space
  18. Wikipedia: Resampling (bitmap)
  19. Wikipedia: Rule of thirds
  20. Wikipedia: sRGB
  21. Wikipedia: TIFF

About Matt George

I'm Matt George, a software engineer in the startup space. I run my own shop building software for early-stage founders, and I love making free tools and experiences that people actually use. Enjoy using Image Cropper!

More Free Tools