How to crop an image using pixel coordinates

Choose a rectangular crop in TinyToolbox with left, top, width, and height values, then verify the resulting PNG.

Open the tool

A screenshot can contain exactly the chart you need along with a full browser window around it. Cropping removes the surrounding area while leaving the selected pixels at their original size. The challenge is describing which rectangle to keep. Once you know how the left and top offsets relate to width and height, you can reproduce the same crop or align several images consistently.

TinyToolbox Image Cropper extracts a rectangle from a JPG, PNG, or WebP and saves it as a PNG. You specify the starting point and the dimensions in pixels. Measure the rectangle in the original image, then check the preview before you distribute the downloaded copy.

Read the four inputs as a rectangle

The top-left corner of the source is at Left 0, Top 0. The left offset grows as you move right. The top offset grows as you move down. Width and height describe how far the rectangle extends from those offsets. If you enter Left 200 and Width 600, the crop starts 200 pixels from the left and spans the next 600 pixels. The right boundary is at 800.

Be careful when copying a selection from a viewer. Some editors report the two opposite corners, while this tool asks for an offset and a size. If the left boundary is 200 and the right boundary is 800, enter 600 for width. If the top boundary is 100 and the bottom boundary is 500, enter 400 for height. Entering the right and bottom coordinates directly as sizes would create a larger crop.

The coordinates refer to the image’s underlying pixels. A 1,400-pixel screenshot might display at 700 pixels wide in a viewer. A position measured at that reduced display size needs to be translated back to the source dimensions before you use it. If you can, use a viewer that displays source pixel coordinates when you select the area. Otherwise compare the displayed and actual dimensions and check your result with the preview.

Crop the image in TinyToolbox

  1. Open Image Cropper.
  2. Choose a JPG, PNG, or WebP under Image file.
  3. Enter the starting position in Left (px) and Top (px).
  4. Enter the desired Width (px) and Height (px).
  5. Select Run tool and inspect the preview.
  6. Choose Download result and open cropped.png.

The tool runs in your browser and uses the standard 25 MB input limit. Each coordinate and dimension must be a whole number. The offsets can be zero, while both dimensions must be at least one pixel. A crop can have up to 4,096 pixels on each side, provided that entire rectangle fits within the source.

A crop changes which part of the original image you keep. The width and height of the download equal the width and height you entered. If the crop size is 600 × 400 and the destination asks for 300 × 200, resize the crop afterward using Image Resizer. That tool changes the pixel dimensions by resampling the image.

Work through a crop of a screenshot

Imagine a 1,400 × 900 screenshot that shows a chart. You want to retain the chart, legend, and a note below it. In your viewer, you determine that their combined area runs from left boundary 200 to right boundary 1,000 and from top boundary 150 to bottom boundary 650.

Enter 200 for Left, 150 for Top, 800 for Width, and 500 for Height. The right boundary is 200 + 800 = 1,000, which fits within the source width. The bottom boundary is 150 + 500 = 650, which fits within the height. The resulting file should contain the selected 800 × 500 rectangle.

Open the preview and look near all four edges. If the right edge cuts off a legend, increase Width while keeping Left the same. That moves only the right boundary. If the left edge cuts into the chart, reduce Left and increase Width by the same amount to keep the right boundary in place. To include more at the bottom, increase Height. Each change is easier to check when you know which boundary should move.

If the chart is going onto a slide, place the PNG at the intended display size and read the note from a normal viewing distance. A crop can make the chart take up more of the slide by removing unused space. It cannot add detail that was absent in the screenshot. If the note is unreadable in the source, capture the chart again at a more useful size.

Calculate a centered crop for a known shape

Suppose a 1,200 × 800 image needs a centered square crop. Choose a square side length of 800 pixels to use the full height. The left margin is half the unused width, or (1,200 − 800) ÷ 2 = 200. The top margin is zero. Enter Left 200, Top 0, and Width and Height 800.

This removes 200 pixels from each side. Check whether the subject is actually centred. If it is closer to one edge, shift Left to keep the necessary content. The size will stay 800 × 800, but the position will change. If you need an automatic circular crop of the centre instead, Circular Image Crop provides a separate workflow with transparent corners.

For a rectangular target such as 16:9, choose integers in that ratio. An 800 × 450 rectangle fits inside the 1,200 × 800 source. To centre it, use Left 200 and Top 175. If an unused dimension is odd, you will have to choose which side gets the extra pixel. Check the final shape and composition rather than assuming that the mathematically centred choice is the best crop for the subject.

Fix a selection outside the image

For a source that is 1,200 pixels wide, Left 900 and Width 400 extend to pixel boundary 1,300. The tool rejects that rectangle. If you want to keep the width, move the left boundary to 800 or less. If you want to keep Left 900, reduce Width to 300 or less. Apply the same check to Top plus Height against the source height.

If those sums appear correct but the tool rejects the input, verify you selected the intended file and measured the opened orientation. Check for a decimal in a field, and confirm neither side exceeds 4,096 pixels. When the work involves several similar screenshots, verify each source’s full dimensions before reusing the same coordinates. A screenshot from another device can have a different scale or layout.

Verify the PNG before sharing

Open the downloaded PNG from disk and check the pixel dimensions. Review the smallest text that needs to remain and look for clipped headings or partial outlines at the edges. Give the checked file a name that identifies the content so it does not get mixed up with another download named cropped.png.

Keep the original when you need to retain the context around the image. If the destination requires JPEG or WebP, use Image Format Converter after cropping and verify the final copy again. The crop is ready when it keeps the complete intended subject and the download matches the rectangle you specified.

Turn a selection measured in a scaled preview into source pixels

Suppose an image viewer shows a 2,400 × 1,600 screenshot at 50% zoom. The visible picture occupies 1,200 × 800 screen units. You measure a section from 160 to 550 horizontally and 90 to 290 vertically, with those positions measured from the displayed image’s own top-left corner. The crop tool needs coordinates from the original file. At half size, multiply each edge position by two. The source edges are 320 and 1,100 horizontally, and 180 and 580 vertically.

Enter 320 for Left and 180 for Top. Subtract the source edge positions for the dimensions. Enter 780 for Width and 400 for Height. Verify that the final right edge is 1,100 and the bottom edge is 580. The downloaded crop should be 780 × 400 pixels. Its size can exceed the number of screen units the selection occupied because the tool retains the source pixels in that rectangle.

When you measure in a viewer, exclude the toolbar and any blank area around the picture. If the display centers the screenshot on a larger canvas, subtract the position where the image actually begins before you scale your measurement. For instance, if the displayed image starts 20 units from the left of the viewer and the selection begins at 180 in the same coordinate system, the picture-relative starting point is 160. The browser window’s origin and the source image’s origin describe different rectangles.

If the viewer gives only an approximate zoom percentage, use its displayed image width and the source width to estimate the conversion factor. Then download and inspect a trial result. When the crop is off by a small amount, compare the chosen boundaries with the original and update the source coordinates. If you need the exact crop of an interface element, use a viewer that reports pixel positions or can show the image at a known scale.

Add context around a selected region without crossing the edge

Imagine a 900 × 600 image contains a label beginning at left 12 and top 150. The label extends to horizontal coordinate 262 and vertical coordinate 230. You want up to 20 pixels of context on each side. Subtracting 20 from both starting coordinates gives a proposed left edge of −8 and a top edge of 130. The crop needs to stay within the image, so start at left 0. The other proposed edges, right 282 and bottom 250, fit.

Enter Left 0, Top 130, Width 282, and Height 120. This includes only 12 pixels to the left of the label and keeps the other requested margins. Check that the cropped label remains readable and that every edge still provides enough context. To add equal margins when the original has too little room on one side, prepare a padded copy in an image editor. The cropper copies pixels within the existing image; it cannot create off-image padding.

The same calculation works near the lower-right edge. Use the image width as the largest allowed right-edge position and the image height as the largest allowed bottom-edge position. Then derive width and height by subtracting the final edges. If you only change the left or top after an out-of-bounds error, check the other edge again. Moving the origin without changing the dimensions moves the entire rectangle.

Keep the crop reproducible across a series of images

To reuse the same crop for several screenshots, note the source dimensions, orientation, and four input values. Open the first and last screenshots before assuming that a menu or label stays in the same place. A responsive interface can shift as the browser window changes, even when two files have similar dimensions. Check at least one landmark, such as the location of the heading or the edge of a panel, before using the same inputs.

Name each download in a way that connects it to its source. If the crop is part of a comparison, keep the original versions as well. A record such as “settings screenshot, 2,400 × 1,600, left 320, top 180, width 780, height 400” gives someone else enough information to repeat the selection. For an upload that also requires exact output dimensions, resize the checked crop only after you confirm the subject and framing. Use dimensions with the same ratio if you need to keep the cropped image’s shape.

Before sharing a cropped screenshot, open the downloaded PNG and scan its edges for stray text or controls you intended to leave out. A thin leftover strip at the edge can be easy to miss in a thumbnail. Correct the crop using the original so you can adjust either direction without losing pixels needed for the final selection.