Watermark
PreviewProxy can overlay a watermark image on top of a source image using the wm parameter.
Usage
The wm parameter accepts a URL pointing to the watermark image. The watermark is composited at its natural size and center-aligned over the source image.
In path-style, use the wm: prefix - no encoding needed:
/wm:https://example.com/watermark.png/https://example.com/photo.jpg
In query-style, the watermark URL must be percent-encoded:
/proxy?url=https://example.com/photo.jpg&wm=https%3A%2F%2Fexample.com%2Fwatermark.png
mẹo
Use a PNG watermark with transparency for best results. The alpha channel is preserved during compositing, allowing the source image to show through.
Supported Watermark Sources
The watermark URL supports the same sources as the main image URL - any configured source can be used:
| Source | Format |
|---|---|
| HTTP | http://example.com/watermark.png |
| HTTPS | https://example.com/watermark.png |
| S3 | s3:/key/path/watermark.png |
| Local | local:/path/to/watermark.png |
| Alias | mycdn:/path/to/watermark.png |
Combining with Other Transforms
The wm parameter can be combined with resize, format conversion, and other transforms in the same request.
/w=1200,webp,wm:https://example.com/watermark.png/https://example.com/photo.jpg