Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1032256 // assertImagesIdentical

JavaX fragment (include)

// for unknown reasons, this fails for comparing color with grayscale
svoid assertImagesIdentical(BufferedImage etc a, BufferedImage etc b) {
  var pix = firstDifferingPixel(a, b);
  if (pix != null)
    fail("Pixel at  " + pix.x + "/" + pix.y
      + " (of " + a.getWidth() + "*" + a.getHeight() + "px): " + intToHex(getPixel(a, pix)) + " vs " + intToHex(getPixel(b, pix)));
}

Author comment

Began life as a copy of #1015234

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032256
Snippet name: assertImagesIdentical
Eternal ID of this version: #1032256/8
Text MD5: 21e7bfb92dcbf5e5005a051392e8c9f3
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-13 01:55:43
Source code size: 383 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 99 / 140
Version history: 7 change(s)
Referenced in: [show references]