MCPcopy Create free account
hub / github.com/fontsource/fontsource / BasicImageTransformations

Interface BasicImageTransformations

website/worker-configuration.d.ts:5531–5597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5529 aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse | Response>;
5530}
5531interface BasicImageTransformations {
5532 /**
5533 * Maximum width in image pixels. The value must be an integer.
5534 */
5535 width?: number;
5536 /**
5537 * Maximum height in image pixels. The value must be an integer.
5538 */
5539 height?: number;
5540 /**
5541 * Resizing mode as a string. It affects interpretation of width and height
5542 * options:
5543 * - scale-down: Similar to contain, but the image is never enlarged. If
5544 * the image is larger than given width or height, it will be resized.
5545 * Otherwise its original size will be kept.
5546 * - contain: Resizes to maximum size that fits within the given width and
5547 * height. If only a single dimension is given (e.g. only width), the
5548 * image will be shrunk or enlarged to exactly match that dimension.
5549 * Aspect ratio is always preserved.
5550 * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
5551 * and height. If the image has an aspect ratio different from the ratio
5552 * of width and height, it will be cropped to fit.
5553 * - crop: The image will be shrunk and cropped to fit within the area
5554 * specified by width and height. The image will not be enlarged. For images
5555 * smaller than the given dimensions it's the same as scale-down. For
5556 * images larger than the given dimensions, it's the same as cover.
5557 * See also trim.
5558 * - pad: Resizes to the maximum size that fits within the given width and
5559 * height, and then fills the remaining area with a background color
5560 * (white by default). Use of this mode is not recommended, as the same
5561 * effect can be more efficiently achieved with the contain mode and the
5562 * CSS object-fit: contain property.
5563 * - squeeze: Stretches and deforms to the width and height given, even if it
5564 * breaks aspect ratio
5565 */
5566 fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
5567 /**
5568 * Image segmentation using artificial intelligence models. Sets pixels not
5569 * within selected segment area to transparent e.g "foreground" sets every
5570 * background pixel as transparent.
5571 */
5572 segment?: "foreground";
5573 /**
5574 * When cropping with fit: "cover", this defines the side or point that should
5575 * be left uncropped. The value is either a string
5576 * "left", "right", "top", "bottom", "auto", or "center" (the default),
5577 * or an object {x, y} containing focal point coordinates in the original
5578 * image expressed as fractions ranging from 0.0 (top or left) to 1.0
5579 * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
5580 * crop bottom or left and right sides as necessary, but won’t crop anything
5581 * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
5582 * preserve as much as possible around a point at 20% of the height of the
5583 * source image.
5584 */
5585 gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | BasicImageTransformationsGravityCoordinates;
5586 /**
5587 * Background color to add underneath the image. Applies only to images with
5588 * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected