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

9
LINES

< > BotCompany Repo | #1032255 // firstDifferingPixel - in scan-line order

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3336L/18K).

static Pt firstDifferingPixel(BufferedImage etc img1, BufferedImage etc img2) {
  assertSameSize(img1, img2);
  int w = img1.getWidth(), h = img1.getHeight();
  for y to h:
    for x to w:
      if (getPixel(img1, x, y) != getPixel(img2, x, y))
        ret pt(x, y);
  null;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032255
Snippet name: firstDifferingPixel - in scan-line order
Eternal ID of this version: #1032255/2
Text MD5: 35fbc4dcebb3e4937b74b43c12aa3417
Transpilation MD5: f1d6ccd119c2a5043bceb736c527e2a2
Author: stefan
Category: javax / images
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-23 01:51:32
Source code size: 284 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 150 / 224
Version history: 1 change(s)
Referenced in: [show references]