import { Image } from "https://deno.land/x/imagescript@v1.2.14/ImageScript.js";
Represents an image; provides utility functions
Methods
Gets the average color of the image
Sets the blue channels saturation
Clones the current image
Composites (overlays) the source onto this image at the specified coordinates
Resizes the image so it is contained in the given bounding box. Can return an image with one axis smaller than the given bounding box.
Resizes the image so it covers the given bounding box, cropping the overflowing edges. Always returns the exact dimensions of the bounding box.
Crops an image to the specified dimensions
Crops the image into a circle
Gets the images dominant color
Draws a box at the specified coordinates
Draws a circle at the specified coordinates with the specified radius
Encodes the image into a PNG
Encodes the image into a JPEG
Fills the image data with the supplied color
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.
Gets the pixel color at the specified position
Gets the pixel color at the specified position
Sets the green channels saturation
Shifts the images hue
Inverts the images colors
Inverts the images hue
Inverts the images saturation
Inverts the images value (lightness)
Yields an [x,y,color] array for every pixel in the image
Sets the brightness of the image
Sets the images opacity
Sets the red channels saturation
Resizes the image to the given dimensions. Use Image.RESIZE_AUTO as either width or height to automatically preserve the aspect ratio.
Rotates the image the given amount of degrees
Rounds the images corners
Sets the saturation of the image
Resizes the image by the given factor
Sets the pixel color for the specified position
Yields an [x,y] array for every pixel in the image
Static Properties
Use Nearest-neighbor resizing.
Static Methods
Converts a color value to an array of RGB values (ignoring the colors alpha)
Converts a color value to an array of RGBA values
Decodes an image (PNG, JPEG or TIFF)
Creates a multi-point gradient generator
Converts HSLA colors to RGBA colors
Converts HSL colors to RGBA colors (assuming an opacity of 255)
Creates a new image from the given SVG
Creates a new image containing the rendered text.
Converts RGBA components to an RGBA value
Converts an RGBA value to an array of HSLA values
Converts RGB components to an RGBA value (assuming alpha = 255)