magica
Version:
ImageMagick for browser and Node.js, easy setup, high level API and Command Line Interface, including WASM binary for an easy setup.
168 lines (167 loc) • 4.28 kB
TypeScript
import { IFile } from '../types';
/**
* Execute `convert $IMG info.json` to extract image metadata. Returns the parsed info.json file contents
* @param img could be a string in case you want to extract information of built in images like `rose:`
*/
export declare function imageInfo(img?: IFile | string | (IFile | string)[]): Promise<ExtractInfoResult[]>;
interface ExtractInfoResult {
image: ExtractInfoResultImage;
error?: Error;
}
export interface ExtractInfoResultImage {
name?: string;
baseName?: string;
format?: string;
formatDescription?: string;
mimeType?: string;
class?: string;
geometry?: ExtractInfoResultGeometry;
resolution?: ExtractInfoResultResolution;
printSize?: ExtractInfoResultPrintSize;
units?: string;
type?: string;
baseType?: string;
endianess?: string;
colorspace?: string;
depth?: number;
baseDepth?: number;
channelDepth?: ExtractInfoResultChannelDepth;
pixels?: number;
imageStatistics?: ExtractInfoResultImageStatistics;
channelStatistics?: ExtractInfoResultChannelStatistics;
alpha?: string;
renderingIntent?: string;
gamma?: number;
chromaticity?: ExtractInfoResultChromaticity;
matteColor?: string;
backgroundColor?: string;
borderColor?: string;
transparentColor?: string;
interlace?: string;
intensity?: string;
compose?: string;
pageGeometry?: ExtractInfoResultPageGeometry;
dispose?: string;
iterations?: number;
compression?: string;
orientation?: string;
properties?: ExtractInfoResultProperties;
profiles?: ExtractInfoResultProfiles;
tainted?: boolean;
filesize?: string;
numberPixels?: string;
pixelsPerSecond?: string;
userTime?: string;
elapsedTime?: string;
version?: string;
}
interface ExtractInfoResultGeometry {
width: number;
height: number;
x: number;
y: number;
}
interface ExtractInfoResultResolution {
x: number;
y: number;
}
interface ExtractInfoResultPrintSize {
x?: number;
y?: number;
}
interface ExtractInfoResultChannelDepth {
alpha?: number;
red?: number;
green?: number;
blue?: number;
}
interface ExtractInfoResultOverall {
min?: number;
max?: number;
mean?: number;
standardDeviation?: number;
kurtosis?: number;
skewness?: number;
entropy?: number;
}
interface ExtractInfoResultImageStatistics {
Overall?: ExtractInfoResultOverall;
}
interface ExtractInfoResultAlpha {
min?: number;
max?: number;
mean?: number;
standardDeviation?: number;
kurtosis?: number;
skewness?: number;
entropy?: number;
}
interface ExtractInfoResultRed {
min?: number;
max?: number;
mean?: number;
standardDeviation?: number;
kurtosis?: number;
skewness?: number;
entropy?: number;
}
interface ExtractInfoResultGreen {
min?: number;
max?: number;
mean?: number;
standardDeviation?: number;
kurtosis?: number;
skewness?: number;
entropy?: number;
}
interface ExtractInfoResultBlue {
min?: number;
max?: number;
mean?: number;
standardDeviation?: number;
kurtosis?: number;
skewness?: number;
entropy?: number;
}
interface ExtractInfoResultChannelStatistics {
Alpha?: ExtractInfoResultAlpha;
Red?: ExtractInfoResultRed;
Green?: ExtractInfoResultGreen;
Blue?: ExtractInfoResultBlue;
}
interface ExtractInfoResultRedPrimary {
x?: number;
y?: number;
}
interface ExtractInfoResultGreenPrimary {
x?: number;
y?: number;
}
interface ExtractInfoResultBluePrimary {
x?: number;
y?: number;
}
interface ExtractInfoResultWhitePrimary {
x?: number;
y?: number;
}
interface ExtractInfoResultChromaticity {
redPrimary?: ExtractInfoResultRedPrimary;
greenPrimary?: ExtractInfoResultGreenPrimary;
bluePrimary?: ExtractInfoResultBluePrimary;
whitePrimary?: ExtractInfoResultWhitePrimary;
}
interface ExtractInfoResultPageGeometry {
width?: number;
height?: number;
x?: number;
y?: number;
}
interface ExtractInfoResultProperties {
[n: string]: any;
'date:create'?: string;
'date:modify'?: string;
signature?: string;
}
declare type ExtractInfoResultProfiles = any;
export {};