Serverless Image Placeholder
A fast, simple, and customizable image placeholder service built with TypeScript, Bun, Nitro, and deployed on Cloudflare Workers.
This is an open-source project designed for serverless environments. You can easily self-host it for free!
Usage
Request images via URLs following the pattern:
/{size}(@nx).{format}?{options}
Size
Specify dimensions as
{width}x{height} or
{width} for a square.
Format Not Implemented Yet
Append a file extension:
.png,
.jpeg,
.gif,
.webp,
.avif,
.svg.
Default is .svg. Example:
/600x400.png
Colors Not Implemented Yet
Use query parameters
?bg={color} and
?fg={color}. Colors can
be hex (#RRGGBB) or
standard CSS names.
transparent is supported
for background.
Defaults: Background
#ddd, Foreground
#999.
Example:
/500?bg=lightblue&fg=darkblue
Example:
/400x150.png?bg=transparent&fg=red
Text Not Implemented Yet
Use query parameter
?text={your+text}. Use
+ for spaces,
\\n for new lines.
Default text is the dimensions. Example:
/300x100?text=Hello+World
Example:
/250?text=Multi\\nLine
Font Not Implemented Yet
Use query parameter
?font={fontname}.
Supported fonts: Lato (Default), Lora, Montserrat, Noto Sans, Open Sans, Oswald, Playfair
Display, Poppins, PT Sans, Raleway, Roboto, Source Sans Pro.
Example:
/400x150?text=Roboto+Font&font=roboto
Retina Not Implemented Yet
Append @2x or
@3x before the format
extension for high-density displays. Only supported for raster formats.
Example:
/600x400@2x.png
Explore the code on GitHub. Contributions are welcome!