
An ImageMagick image has pixel dimensions and separate virtual-canvas size/offset metadata. A crop can therefore contain fewer pixels while retaining information about its previous placement. Use +repage when a standalone crop should discard that old canvas relationship, rather than assuming the crop failed.
The repage reference distinguishes changing canvas metadata from resampling pixels. Do not remove offsets automatically from images that still need to be positioned as layers or animation patches.
Report the pixel rectangle and canvas separately
The official property reference lists %w and %h for current pixel dimensions and %g for layer canvas geometry. Record both when diagnosing an apparently unchanged crop.
For a proposed POSIX-shell inspection using a built-in example:
magick rose: -crop 20x20+10+5 -format '%wx%h %g
' info:
This command has not been executed. It requests a diagnostic report rather than writing an image file. Its example coordinates are chosen for demonstration, not a general crop recommendation.
Decide whether the placement information is required
For a standalone thumbnail, a retained larger canvas or nonzero offset may be unwanted. For a layered assembly, that same offset can preserve where the cropped region belongs in a larger composition.
Write which artifact the next step needs. A change that fixes standalone placement can break a workflow relying on those coordinates. Do not treat every nonzero offset as corrupt metadata.
The transparent-padding guide concerns actual empty pixels around content. Virtual canvas metadata is another resource: resetting it is not equivalent to trimming a transparent pixel border.
Reset the metadata at the intended point
The documented +repage form removes/resets virtual-canvas metadata. Place it after the crop when the desired output is independent of its original placement.
The related -repage form can change specified canvas or offset components. Do not substitute an arbitrary canvas size when the actual requirement is simply to remove the old relationship. Neither operation reconstructs pixels excluded by the crop.
Reinspect the actual saved artifact
Compare current dimensions and canvas geometry before and after the chosen metadata operation, then open a separately named saved output in the receiving application. Check its content boundaries as well as its position.
Keep the approved version identifiable, especially if both placement-preserving and standalone derivatives are needed. This article offers a metadata diagnosis and proposed check; it reports no generated crop, recovered image area or tested downstream layout.
Related tasks
- Why Does My Transparent PNG Look Tiny Despite Its Large Pixel Dimensions?
- How Do I Keep the Approved AI Image or Video from Getting Lost Among Revisions?
Sources and scope
- ImageMagick Command-line Options: repage: Pixel bounds and virtual canvas metadata differ; +repage resets canvas/offset metadata when a standalone crop should no longer keep its previous placement.
- ImageMagick Command-line Processing: Immediate operators, persistent settings and isolated image stacks have different command-line scope.
This guide follows official ImageMagick 7 documentation captured on October 23, 2026 (Asia/Shanghai), whose site identifies release 7.1.2-34. Examples are proposed and have not been executed. Confirm the installed build, available formats and actual shell quoting 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: Mariya Eskina / Pexels, Pexels License. This is an illustrative source photograph, not an application screenshot or a generated test result.