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

9
LINES

< > BotCompany Repo | #1006553 // bwImageTo2Bit_inner

JavaX fragment (include)

static BWImage bwImageTo2Bit_inner(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 ? 0f : 1f);
  }
  ret img2;
}

Author comment

Began life as a copy of #1006551

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: #1006553
Snippet name: bwImageTo2Bit_inner
Eternal ID of this version: #1006553/1
Text MD5: bd7d9935ef6873ef7e48fe79572b62f8
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 05:04:17
Source code size: 310 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 411 / 438
Referenced in: [show references]