1 | static BWImage bwImageTo2Bit_outer(BWImage img, float threshold1, float threshold2) { |
2 | int w = img.w(), h = img.h(); |
3 | BWImage img2 = new BWImage(w, h); |
4 | for y to h: for x to w: { |
5 | float f = img.getPixel(x, y); |
6 | img2.setPixel(x, y, f < threshold1 || f > threshold2 ? 1f : 0f); |
7 | } |
8 | ret img2; |
9 | } |
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: | 470 / 494 |
Referenced in: | [show references] |