
Declare a custom ImageMagick morphology kernel's full dimensions and origin when its result grows or shifts unexpectedly. The geometry before the colon specifies the whole kernel, not a radius. The origin defines the pixel whose neighborhood is evaluated and need not sit at the geometric center.
Draw the matrix before writing the string
Write width, height and the intended origin on a small matrix. Count the supplied entries: an explicit width-by-height kernel needs that many values, including positions that will be excluded from the neighborhood.
The official DIY-kernel reference distinguishes this from a named kernel's radius argument. An old-style value list without geometry can create an inferred odd square for compatibility; explicit geometry makes the intended arrangement reviewable.
Encode an asymmetric neighborhood
The source illustrates a two-by-three neighborhood with a noncentral origin:
magick single-pixel.png -morphology Dilate '2x3+1+1: 1,- 1,- 1,1' kernel-shape.png
This proposed POSIX-shell presentation has not been executed. The input should be a controlled single foreground pixel with sufficient background around it, not an arbitrary photograph. Confirm installed ImageMagick 7 support and shell syntax.
The dash marks an undefined neighborhood element. Such positions still occupy cells in the declared rectangle; omitting their entries changes the matrix rather than making the same shape shorter.
Separate origin from participating cells
The reference permits an origin that is not itself included in the neighborhood. Do not force that cell to one merely to make the layout look symmetric.
Inspect the result relative to the known source pixel and the declared origin. Record the orientation actually produced by the chosen method; do not infer every operator's reflection or sampling convention solely from a drawn matrix.
The GIMP clone-alignment guide concerns source-to-stroke offsets. Here placement comes from a kernel's internal anchor and neighborhood definition, with no brush gesture involved.
Verify geometry before applying the kernel broadly
Compare two deliberately different origin choices while keeping the matrix values and input fixed. Inspect whether the resulting placement matches the intended operation before processing real artwork.
The source-coordinate mapping guide handles scaled previews, a separate coordinate boundary. This task's acceptance artifact is a declared kernel matrix and its inspected anchor behavior. No morphology test or mathematically verified filter has been performed.
Related tasks
- Why Does GIMP Clone from the Wrong Place on My Second Brushstroke?
- Why Does My Image Edit Land in the Wrong Place When I Copy Preview Coordinates?
Sources and scope
- ImageMagick morphology examples: user: User kernel geometry specifies overall dimensions and optional origin; it requires width-times-height values, with undefined cells excluded from the neighborhood.
- ImageMagick 7 morphology operator: Current command-line reference links to the official morphology examples; confirm installed methods and kernels.
The official ImageMagick morphology usage page was captured with HTTP 200 on October 23, 2026. It includes historical examples and explicit legacy version notes. Commands, calculations and acceptance exercises here are proposed, not executed; verify the installed ImageMagick 7 methods, kernel behavior, quantum precision 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: Paparazzi Ratzfatzzi / Pexels, Pexels License. This is an illustrative source photograph, not an application screenshot or a generated test result.