Watermark Resize Filter
mark-resize-filter
Sets the resampling kernel used when the mark image is resized, including resizes driven by mark-scale. The default is lanczos2.
Use mark-resize-filter[N] to set the kernel for a specific watermark layer.
Accepted values
| Value | Aliases | Best for |
|---|---|---|
lanczos2 | — | Default. Photographic layers. A good balance of sharpness and freedom from artifacts. |
lanczos3 | lanczos, photo, sharp | A sharper result than lanczos2, at the cost of more ringing around high-contrast edges. |
bicubic | cubic, catmull-rom | Smooth gradients with moderate sharpening. |
mitchell | graphic, soft | Softer output with less ringing. Useful for graphics and flat color. |
bilinear | linear | Fast and smooth, noticeably softer than the cubic and lanczos kernels. |
nearest | pixel | Hard edges with no interpolation. The right choice for pixel-art badges, QR codes and UI screenshots. |
Values are matched exactly and are case-sensitive. A value that matches nothing — including a correctly spelled kernel in the wrong case, such as NEAREST — is ignored, and the watermark resizes with the default lanczos2 instead of returning an error. These are the same values resize-filter takes for the base image.
Upscaling a small watermark
The kernel matters most when a watermark is enlarged, because every output pixel has to be invented from a handful of source pixels. The demo below takes a 40-pixel-wide pineapple and places it at 240 pixels: lanczos2 interpolates between the source pixels and softens the result, while nearest repeats each one as a solid block. The first entry is the same layer sourced at full size, for reference, and every other kernel is on the rows beneath.


Neither result is wrong — a photographic badge usually wants the interpolation and a pixel-art one usually does not.
Every kernel is there to switch between, but on an upscale the four smooth ones agree almost exactly: interpolating between the same handful of source pixels, lanczos3, bicubic, mitchell and bilinear all land within a pixel code or two of lanczos2. A downscale is where they separate, and resize-filter compares them there — a kernel behaves the same on a watermark as it does on the base image.
Layers do not inherit the kernel
A watermark resizes with lanczos2 unless mark-resize-filter is set for it, whatever resize-filter says for the base image. The two are independent, which is what lets a pixel-art badge stay crisp while the photograph behind it resizes normally:
?w=800&mark=badge.png&mark-w=96&mark-resize-filter=nearest