
Use -virtual-pixel to choose values an operation samples beyond the source image. This changes the boundary condition for operations such as blur, convolution and distortion; it does not itself enlarge the image or add deliverable border pixels. A mirrored sampling boundary and a visible mirrored border are different outputs.
Identify an out-of-bounds lookup
A blur near an edge can need neighboring values outside the available raster. ImageMagick documents methods including edge, mirror, tile, background and transparent for supplying such virtual values.
Choose the method for the intended mathematical boundary. Extending the last edge pixel is different from reflecting the image or treating the surrounding area as a background color. None of these choices invents additional photographed scene detail.
Put the sampling choice before the operation
A proposed POSIX-shell comparison is:
magick input.png -virtual-pixel edge -blur 0x4 edge-sampling.png
magick input.png -virtual-pixel mirror -blur 0x4 mirror-sampling.png
These commands have not been executed. Confirm the installed ImageMagick 7 build, shell quoting and operation support. Compare the same input with the same blur setting; otherwise an edge difference cannot be attributed cleanly to the sampling policy.
The official page's method table and prose contain inconsistent default wording. Select the required method explicitly rather than depending on an assumed default across versions.
Inspect edges without expecting a larger canvas
Look at a distinctive line or color patch close to each boundary. Compare how its influence extends into the blurred interior. Also compare the output raster dimensions: this example requests a boundary rule, not enlargement.
If the requirement is actual extra pixels around the picture, use a documented canvas or border operation separately. The canvas-border guide addresses that deliverable; choosing a virtual-pixel method alone does not satisfy it.
Keep padding removal separate
Trimming transparent or colored padding removes real edge space. The trim-basis guide concerns those existing pixels, not values supplied to a filter outside the image.
For acceptance, record the selected boundary method and inspect the affected edge treatment at the intended display size. Retain a separate requirement for raster dimensions. This distinction prevents a plausible-looking blur from being mistaken for a padded asset or a completed scene extension.
Related tasks
- Photoshop Trim: Remove Transparent Padding or a Solid Edge Color?
- How Do I Add a Border in Photoshop Without Stretching the Photo?
Sources and scope
- ImageMagick 7 option reference: virtual-pixel: Virtual pixels supply values to out-of-bounds lookups by distortions, convolution and blur rather than creating actual border pixels.
Documentation-based ImageMagick 7 guidance checked against official pages captured October 23, 2026. Examples and inspections are proposed, not performed. Confirm the installed build, coder support 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: Mariya Eskina / Pexels, Pexels License. This is an illustrative source photograph, not an application screenshot or a generated test result.