Model Details
Fast Image Resizer scales an image to a size you specify and returns a JPEG — whatever format you sent in. It is a plain, deterministic resize — Pillow resampling, no generative model and no invented detail — so the same input always gives the same result. With `keep_aspect_ratio` at its default `true` the image is shrunk to fit inside the `width` × `height` box with its proportions intact — an 800×600 photo into a 200×200 box gives 200×150 — and with `keep_aspect_ratio: false` it is stretched to exactly `width` × `height`, even when that changes its shape. Typical jobs are thumbnails, web assets, and normalising a folder of images to one size before another model sees them.
## Best for - Making thumbnails from large photos at a fixed maximum size - Producing an image at exact pixel dimensions when a layout or spec demands them - Shrinking oversized uploads before you store or serve them - Normalising an image dataset to one consistent size before training or batch inference - Preparing web and app assets where every image must fit the same box
## Choose another model when - You need the image to come out bigger than it went in. On the default path it never enlarges — ask for 2048×2048 from an 800×600 source and you get 800×600 back, unchanged and still billed. `keep_aspect_ratio: false` fills the box by stretching, not by adding detail, so use an upscaling model for real enlargement. - Your input carries transparency or a colour palette. Such PNG and GIF files fail the run outright with `cannot write mode RGBA as JPEG` or `cannot write mode P as JPEG` — flatten onto a solid background, or pick a model that writes PNG. - You want a crop-to-fill that covers the box edge to edge — this model only fits inside the box or stretches to it, so use a cropping or image-editing model.
## Tips - On the default path treat `width` and `height` as a bounding box, not as the output size: the result is the largest fit inside them, and never larger than the source. - Set `keep_aspect_ratio: false` only when the exact output dimensions matter more than the proportions.
## Limitations - JPEG quality is fixed — there is no compression or quality control. - No cropping, padding, rotation, or output-format choice.
To run via the ModelRunner JavaScript client: ```js import { modelrunner } from "@modelrunner/client";
const result = await modelrunner.subscribe("grey-hound432/fast-image-resizer", { input: { image: "https://media.modelrunner.ai/YfJkKwD17pagVEM6QNAeq.webp", width: 320, height: 320, }, }); ```


