Libraryless. Click here for Pure Java version (10787L/62K).
// white = certain (either completely black or completely white) // black = uncertain (exactly 50% gray) static BWImage certaintyImage(IBWImage img) { ret bwImageFromFunction(img.getWidth(), img.getHeight(), (x, y) -> { double pix = img.getFloatPixel(x, y); ret absdiff(pix, 0.5)*2; }); }
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035826 |
Snippet name: | certaintyImage |
Eternal ID of this version: | #1035826/1 |
Text MD5: | c8ba7322d4a1e5a54cfe3ee9ee25919c |
Transpilation MD5: | 688bd8543ff6b8f5e046b4bd90af8d1c |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-08-02 00:18:45 |
Source code size: | 318 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 121 / 171 |
Referenced in: | [show references] |