Compare Images

Compute a visual diff between two images. Supports both multipart/form-data file uploads and JSON with base64-encoded data URLs.

post/image

Request

  • Base URL: https://api.diffchecker.com/public
  • URL: https://api.diffchecker.com/public/image
  • Auth: one of:
    • API key in header X-Api-Key
    • API key in query parameter email

Query parameters

emailstring email

Your email address. Required if not using an API key.

input_type'json' | 'form' required

Specifies the request content-type.

  • form: multipart/form-data
  • json: application/json
output_type'json' | 'png' required

Specifies the type of output you receive in the response body.

  • json: Same PNG you see on the Diffchecker site for image diffs, but embedded in JSON as a data URL (Content-Type: application/json)
  • png: Same PNG you see on the Diffchecker site for image diffs (Content-Type: image/png)

Headers

Diffchecker-Version'1'

API version to serve the request with. Defaults to the newest version, currently 1, when omitted. An unsupported version is rejected with 400 UNSUPPORTED_API_VERSION. See Versioning and Deprecation in the getting started guide.

Request body

left_imagestring required

Data URL of the left image you want to diff.

right_imagestring required

Data URL of the right image you want to diff.

Response

Diff computed successfully.

creditsUsedinteger required

Credits charged for the diff request.

dataUrlstring required

Data URL of the diff image (PNG).

diffPixelsinteger required

Number of pixels that differ.

totalPixelsinteger required

Total number of pixels compared.

misMatchPercentagenumber float required

Percentage of pixels that differ.

widthinteger required
heightinteger required
originalWidthinteger required
originalHeightinteger required
changedWidthinteger required
changedHeightinteger required

Changes

No recorded changes to this operation across all 1 revision of this API.