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

9
LINES

< > BotCompany Repo | #1006551 // bwImageTo2Bit_outer

JavaX fragment (include)

static BWImage bwImageTo2Bit_outer(BWImage img, float threshold1, float threshold2) {
  int w = img.w(), h = img.h();
  BWImage img2 = new BWImage(w, h);
  for y to h: for x to w: {
    float f = img.getPixel(x, y);
    img2.setPixel(x, y, f < threshold1 || f > threshold2 ? 1f : 0f);
  }
  ret img2;
}

Author comment

Began life as a copy of #1006251

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006551
Snippet name: bwImageTo2Bit_outer
Eternal ID of this version: #1006551/1
Text MD5: acab07cba12e4b2c8ed67fb6f067b1ea
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-16 04:47:39
Source code size: 310 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 468 / 491
Referenced in: [show references]