
ImageMagick smush packs the nontransparent parts of images rather than preserving their source rectangles as equal cells. At zero offset, it brings visible content close without overlap. If your assets include different amounts of transparent padding, the joined result can therefore differ from a fixed-cell contact sheet.
Choose compact packing or a grid
For compact artwork, reducing empty gaps may be desirable. For a comparison sheet or sprite layout with prescribed cell coordinates, keeping equal source rectangles may be essential.
State which object owns the spacing requirement: each image's full raster box or its nontransparent content. The same source files can be valid inputs for either task but require different assembly choices.
Use the documented direction and gap
A proposed POSIX-shell example joins two assets horizontally:
magick a.png b.png -background none +smush 0 packed.png
This command has not been executed. Confirm the installed ImageMagick 7 support and the input alpha representation. The reference describes +smush for left-to-right joining and -smush for top-to-bottom joining.
The numeric offset supplies the gap; a negative value permits overlap. Gravity and background also affect the result. Choose them deliberately rather than treating a negative gap as a way to preserve invisible padding.
Inspect faint content before packing
A subtle shadow or antialiased fringe can be part of the nontransparent extent. Compare the actual edges and the intended visible gap; do not assume a transparent-looking preview defines a precise bounding shape.
The trim-basis guide changes individual image bounds. Smush instead assembles a sequence using transparency-aware spacing, without making every input a separately trimmed delivery asset.
Reject compact packing for a cell contract
If the next tool needs regular cell positions, use an assembly method that explicitly provides those cells and verify their dimensions and offsets. A compact result is not defective merely because it lacks that unrelated grid contract.
The contact-sheet budget guide plans fixed rows, columns and sampled frames. Here the deliverable is either intentionally packed artwork or a clear decision to use a fixed-cell route instead.
Compare the assembled output with the input identities, intended order and spacing requirement. No assembly run, collision-free packing benchmark or universal sprite-sheet compatibility is claimed.
Related tasks
- Plan an FFmpeg Tile Contact Sheet by Its Frame Budget
- Photoshop Trim: Remove Transparent Padding or a Solid Edge Color?
Sources and scope
- ImageMagick official mechanism reference: Smush joins an image sequence while ignoring transparency, supports horizontal/vertical directions, negative overlap, gravity and background fill.
Official ImageMagick references were captured October 23, 2026. Morphology usage includes historical and experimental notes, which do not establish current-build regressions or guarantees. Examples and acceptance checks are proposed, not executed; confirm installed-build support, pixel representation and shell syntax.
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.