Any size from the URL
w=800,h=600,fit=cover, gravity (or auto for the interesting part), quality, format, device pixel ratio, blur, sharpen and rotate. Named sizes too: thumbnail, avatar, small, medium, large.
Upload an image and get URLs for every size you need, as AVIF or WebP for the browsers that take them. Sizes are made the first time they are asked for and then served from the CDN, so you pay for a size once, not for every view.
// lyrcloud.json: "images": "IMAGES"
export default {
async fetch(request, env) {
const image = await env.IMAGES.upload(await request.arrayBuffer(), {
metadata: { alt: 'A red bike' },
});
return Response.json({
thumbnail: image.urls.thumbnail, // 200ร200, cropped
hero: image.base + 'w=1600,h=900,fit=cover', // any size, AVIF or WebP
});
},
};
// $ lyrcloud images upload bike.jpg
// $ lyrcloud images url <id> w=400,h=300,fit=cover
w=800,h=600,fit=cover, gravity (or auto for the interesting part), quality, format, device pixel ratio, blur, sharpen and rotate. Named sizes too: thumbnail, avatar, small, medium, large.
One URL; each browser gets the smallest format it can show. Transparent images stay transparent.
A size counts as a transform the first time it is made. Every view after that comes from the CDN, free.
Mark an image private and it is only served with a signed link that expires.
env.IMAGES.upload() from a function, a URL to fetch, the CLI, the dashboard, or a one-time form the browser posts straight to storage (up to 20 MB).
Launch: 1,000 images and 5,000 transforms a month. Scale: 100,000 and 100,000. Enterprise: 1M and 1M. Past that, $0.50 per 1,000 transforms from Lyrcloud credit.
Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.
Learn moreResponse caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.
Learn moreRate limits, IP rules, a firewall for common attacks, bot checks and secure headers for your edge functions, set in lyrcloud.json and enforced before your code runs.
Learn moreCreate a free account in under a minute. No credit card required.