Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/imagescript/mod.ts>Image#fit

zero-dependency JavaScript image manipulation
Extremely Popular
Go to Latest
method Image.prototype.fit
import { Image } from "https://deno.land/x/imagescript@v1.2.14/mod.ts";

Resizes the image so it is contained in the given bounding box, placing it in the center of the given bounding box. Always returns the exact dimensions of the bounding box.

Parameters

width

The width of the bounding box

height

The height of the bounding box

optional
mode = [UNSUPPORTED]