Skip to main content

Interface: CompareImageInput

Defined in: packages/uimatch-core/src/core/compare.ts:116

Input for image comparison.

Extends

  • SizeHandlingOptions

Properties

align?

optional align: ImageAlignment;

Defined in: packages/uimatch-core/src/core/compare.ts:92

Alignment for image positioning in pad and crop size modes. Determines where the image is positioned within the canvas.

Default

'center'

Inherited from

SizeHandlingOptions.align

contentBasis?

optional contentBasis: ContentBasis;

Defined in: packages/uimatch-core/src/core/compare.ts:110

Content basis for calculating pixelDiffRatioContent denominator.

  • union: Union of both content areas (default for backward compatibility)
  • intersection: Intersection only (excludes padding-induced expansion) - recommended for pad mode
  • figma: Figma's original content area
  • impl: Implementation's original content area

Default

'union' (but CLI automatically uses 'intersection' when sizeMode='pad')

'intersection' for pad comparisons to exclude letterboxing noise

Inherited from

SizeHandlingOptions.contentBasis

diffOptions?

optional diffOptions: DiffOptions;

Defined in: packages/uimatch-core/src/core/compare.ts:167

Diff options (thresholds, ignore, weights) (optional).


expectedSpec?

optional expectedSpec: ExpectedSpec;

Defined in: packages/uimatch-core/src/core/compare.ts:142

Expected style specification (optional). Required if styles is provided.


figmaPngB64

figmaPngB64: string;

Defined in: packages/uimatch-core/src/core/compare.ts:120

Figma design PNG as base64 string.


implPngB64

implPngB64: string;

Defined in: packages/uimatch-core/src/core/compare.ts:125

Implementation screenshot PNG as base64 string.


meta?

optional meta: Record<string, {
class?: string;
cssSelector?: string;
id?: string;
tag: string;
testid?: string;
}>;

Defined in: packages/uimatch-core/src/core/compare.ts:148

DOM element metadata (optional). Used to enrich style diffs with precise CSS selectors.


padColor?

optional padColor: "auto" | PadColor;

Defined in: packages/uimatch-core/src/core/compare.ts:98

Background color for padding. 'auto' uses detected background color.

Default

'auto'

Inherited from

SizeHandlingOptions.padColor

pixelmatch?

optional pixelmatch: PixelmatchOptions;

Defined in: packages/uimatch-core/src/core/compare.ts:130

Pixelmatch configuration options.


sizeMode?

optional sizeMode: SizeMode;

Defined in: packages/uimatch-core/src/core/compare.ts:85

How to handle dimension mismatches.

Default

'strict'

Inherited from

SizeHandlingOptions.sizeMode

styles?

optional styles: Record<string, Record<string, string>>;

Defined in: packages/uimatch-core/src/core/compare.ts:136

Captured styles from implementation (optional). If provided, style differences will be calculated.


tokens?

optional tokens: TokenMap;

Defined in: packages/uimatch-core/src/core/compare.ts:162

Token map for design tokens (optional).