dmtrKovalenko / odiff

The fastest pixel-by-pixel image visual difference tool in the world.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] Combine reference and diff images and add custom color parameter

viraxslot opened this issue · comments

Hi,
Problem: sometimes diff image is really small and it's hard to understand the difference between current and reference images.
Proposal: allow to generate diff2 image that add diff-mask above the reference image;
Proposal 2: mark such differences somehow if there are small (circle around them or so);

Of course, if the reference image has a lot of red it could be a problem (because diff-image is always red), so we need also a parameter for diff-image color.

Thanks in advance :)

Does diffImage param is what you need?

type ODiffOptions = {
  /** Output full diff image. */
  diffImage: boolean;
  /** Do not compare images and produce output if images layout is different. */
  failOnLayoutDiff: boolean;
  /** Color difference threshold (from 0 to 1). Less more precise. */
  threshold: number;
};

declare function compare(
  basePath: string,
  comparePath: string,
  diffPath: string,
  options?: ODiffOptions
): Promise<
  { match: true } | { match: false; reason: "layout-diff" | "pixel-diff" }
>;

@dmtrKovalenko sorry, my bad, I didn't notice this option. It works fine with diffImage: true, thanks.
So, I can keep only custom color feature request :)

Also it would be nice to set only one option, because all are mandatory now.