Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/imagescript/ImageScript.js>Image#fit

zero-dependency JavaScript image manipulation
Extremely Popular
Latest
method Image.prototype.fit
import { Image } from "https://deno.land/x/imagescript@1.3.0/ImageScript.js";

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]

The resizing mode to use