Resize an image by height, keeping its format and transparency

FeatureConversionService
Shipped
September 3, 2026 at 10:55 PM UTC
Author
Kamo
Commit
aadfa49

Backs the email signature footer badges, which are downscaled to 150px tall on upload. resize-bg could not be reused. It exists to make a wallpaper cheap to ship, so it re-encodes everything to lossy WebP and fits it inside a box — and a badge is composited into a message body by mail clients (every Outlook on Windows among them) that cannot display WebP at all, on whatever background the recipient's client paints. So the format that was uploaded is the format that comes back: PNG through ffmpeg's negotiated pixel format, GIF through palettegen/paletteuse with a reserved transparent entry (animation intact), WebP lossless, JPEG at high quality. An SVG is returned untouched — a vector has no pixel height, and ffmpeg cannot read it either. An image already inside the limit comes back byte-for-byte. Re-encoding 'for consistency' is lossy for JPEG, re-palettises a GIF, and would discard an animation nobody asked to lose; being too tall is the only reason to touch it.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing