
For a raw-image subregion, give -extract both dimensions and offsets, such as 640x480+1280+960. The ImageMagick documentation explicitly says that omitting the offsets changes the operation to resizing. A result with the requested width and height therefore does not, by itself, prove that a region was extracted.
Write down two different rectangles
The source raster dimensions describe the whole input. The extract rectangle describes which portion you want from that raster. Keep those values in separate fields rather than substituting the desired output dimensions for the source's -size.
In the documentation's example, the source is 16000 by 16000 pixels; the selected rectangle is 640 by 480, beginning 1280 pixels from the left and 960 from the top. These are example values, not measurements of your asset.
Include offsets before reading raw data
A proposed POSIX-shell version of that documented operation is:
magick -size 16000x16000 -depth 8 -extract 640x480+1280+960 image.rgb region.png
Source dimensions and depth must match the real raw RGB payload. This guide has not run the command and makes no memory-use or processing-time claim. Confirm the installed ImageMagick 7 coder and adapt shell syntax before use.
With -extract 640x480 instead, the manual describes resizing to those dimensions. Adding offsets is a semantic choice, not merely a way to improve precision. For a region beginning at the origin, express the intended origin explicitly rather than dropping the offset portion.
Validate the selected content
Choose recognizable features near the requested rectangle's corners. Compare their expected source positions with the delivered region. If the output shows the whole scene squeezed into a small image, matching dimensions have concealed a resize rather than established a crop.
Use source-pixel coordinates. A preview may be scaled or letterboxed; the coordinate-mapping guide explains that separate translation problem.
Keep this operation separate from resampling
If the real goal is a thumbnail of the whole input, resizing is appropriate. If it is an inspection patch, accepting that thumbnail would lose the intended spatial sample even though its dimensions look correct.
The pixel-versus-percentage guide discusses another coordinate contract. Here acceptance requires the particular source rectangle, interpreted using the actual raw decoder settings. It does not assert that every compressed format supports an equally efficient regional read.
Related tasks
- How to Keep a ComfyUI Conditioning Area in the Same Relative Place After Resizing
- Why Does My Image Edit Land in the Wrong Place When I Copy Preview Coordinates?
Sources and scope
- ImageMagick 7 option reference: extract: -extract 640x480+1280+960 selects a raw region while omitting offsets requests resize.
Documentation-based ImageMagick 7 guidance checked against official pages captured October 23, 2026. Commands are proposed POSIX-shell examples, not executed tests. Confirm the installed build, coder support, source specification and actual shell before use.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Paparazzi Ratzfatzzi / Pexels, Pexels License. This is an illustrative source photograph, not an application screenshot or a generated test result.