export class Image {
No description provided.
Target style API. Preferred for new code.
Members
22 itemsTarget Style
Target Style
static load({ from }) {
/** Loads an image wrapper from a file path.
async metadata() {
/** Returns cached image metadata.
async trim({ threshold = THRESHOLD } = {}) {
/** Trims image borders using a color threshold.
async makeSquare() {
/** Resizes the image to a centered square.
async hasBorders() {
/** Detects whether the image has solid borders.
async perceptualHash({ complexity = HASH_COMPLEXITY } = {}) {
/** Returns a perceptual hash for the image.
async differenceHash({ complexity = HASH_COMPLEXITY } = {}) {
/** Returns a difference hash for the image.
async dominantColor() {
/** Returns the dominant image color.
async averageColor() {
/** Returns the average image color.
async dimensions() {
/** Returns current image dimensions.
async aspectRatio() {
/** Returns the current image aspect ratio.
Legacy Style
Legacy Style
constructor(buffer) {
/** Builds an image wrapper from a file path or raw buffer.
async getMeta() {
/** Returns cached image metadata.
async crop(threshold = THRESHOLD) {
/** Trims image borders using a color threshold.
async square() {
/** Resizes the image to a centered square.
async getHash(complexity) {
/** Returns a perceptual hash for the image.
async getPHash(complexity = HASH_COMPLEXITY) {
/** Returns a perceptual hash for the image.
async getDHash(complexity = HASH_COMPLEXITY) {
/** Returns a difference hash for the image.
async getDominantColor() {
/** Returns the dominant image color.
async getAverageColor() {
/** Returns the average image color.
async getDimentions() {
/** Returns current image dimensions.
async getRatio() {
/** Returns the current image aspect ratio.