Image resizing and optimisation API
Resize and optimise images with a URL.
Upload one original and ask for the size, crop, format and quality you need in the image URL. Fileboy makes each version the first time it is asked for, then caches it.
One URL, many images
- Resizeresize:300x_
- CropsmartCrop:300x300
- Formatformat:auto
- Watermarktext or logo
The original, changed by its URL
Each picture below is the same demo photo, served by Fileboy with the transform under it. Nothing is edited by hand, and you upload the original only once.
Resized
A width, and the height follows.
?transform=resize:300x_Smart crop
A square around the part with the most detail.
?transform=smartCrop:300x300Round avatar
Cropped, then rounded to a circle.
?transform=smartCrop:300x300;radius:maxText watermark
A credit drawn into the image.
?transform=resize:300x_;text:%C2%A9%20Fileboy~size:8pc~color:white~background:hex(00000080)~padding:6~position:bottom-left~x:8~y:8Change the URL, see the image
Move the sliders and the transform in the URL changes with them. The image underneath is fetched from Fileboy as you go.
What you can do with an image
Resize, crop and reshape
Width, height, fit, aspect ratio, crop, rotate, flip, padding, borders and rounded corners, all in the image URL. Chain up to 20 steps with ; and they run in order. See every transform.
WebP and AVIF
format:auto serves AVIF, then WebP, then the original format, whichever the browser says it accepts. In our tests, photos came out about 30% smaller as AVIF than as WebP at the same visual quality. Images over 16 megapixels are sent as WebP instead of AVIF.
Smart crop
Crop to the part of the image with the most detail, colour and skin tone instead of the centre. Add ~focus:faces for avatars and Fileboy keeps faces whole. It never recognises or identifies anyone.
Watermarks
Draw text or a logo from your own app on top, in a corner or tiled across the image, with opacity and rotation. The original stays clean. Read the watermark guide.
Colour palettes
Fileboy works out the main colours of every image you upload. Ask for them as JSON or CSS with the palette transform, for placeholders and themes. Colour palettes
Named presets
Save a chain under a name and use preset:thumbnail in your URLs. Change the preset and every image that uses it changes, and your URLs stay short. Transform presets
Responsive images
The React Image component builds a srcset with one URL for each width, so phones download small images. Pair it with format:auto.
Made once, then cached
Each transform of an image is made the first time it is asked for and kept, so repeat requests are served from the cache. Up to 200 versions are kept for each image, and the kept versions count toward your storage.
Private images
Sign a URL, or use an expiring link, so only the people you choose can read an image. Signed URLs
AI edits (AI add-on)
Remove the background from an image or upscale it, from the API. These send the image to OpenAI and need the AI add-on, which is on paid plans. AI image edits
Use it from a tag, React or your server
A transform is just part of a URL, so an <img> tag is enough. The libraries build the URL for you, for React, Vue, Svelte, Next.js, Node.js, Ruby, Python and PHP.
Not sure how to start? Follow the resize guide or see the libraries.
<img
alt="Our harbour"
src="https://api.fileboy.io/images/get/FILE_ID?transform=smartCrop:400x400;format:auto;quality:75"
/>A good fit for
- Thumbnails, avatars and galleries of images people upload
- Responsive images for a site you do not want to rebuild
- Product photos in several sizes and formats from one original
- Images that need your logo or a credit on them
Good to know
- JPEG, PNG, WebP, BMP, TIFF and HEIC can be transformed (a HEIC comes back as a JPEG unless you ask for another format). GIF, SVG and other files are served as they are.
- Sources larger than about 67 megapixels cannot be transformed.
- New versions are limited to 120 a minute from one client address for each app, and versions already made are still served. Signed URLs and your private key are not limited.
See pricing for storage and transfer on each plan.
Guides for images
Worked examples with code you can paste.
Store one original, then ask for any size or format by editing the image URL.
Give every image a srcset and a WebP source, for images that arrive after you have deployed.
Users upload photos in every shape. Get a consistent square out of all of them.
Put your logo or a credit on every image you serve, and keep the originals clean.
Cloudinary, imgix, ImageKit, Cloudflare Images, Uploadcare, Fileboy or your own pipeline on S3: a fair look at what each is for.
A custom loader that asks Fileboy for the width and quality Next.js wants, with no image processing in your app.
Cut out a product photo and have alt text written for uploads, from your server. Both need the AI add-on.
Read the text in receipts, signs, screenshots and scanned pages, and get it back from your server. Needs the AI add-on.
Resize your first image free
Create an app, upload an image and ask for any size or format in its URL. The free plan needs no card.