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

16
LINES

< > BotCompany Repo | #1035420 // imageToBinary - extended synonym of bwImageToBinary

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

Libraryless. Click here for Pure Java version (10723L/61K).

// anything >= threshold ends up white
static Image2B imageToBinary(BufferedImage img, double threshold) {
  ret bwImageToBinary(new BWImage(img), zeroToOneToZeroTo255(threshold));
}

static Image2B imageToBinary(BufferedImage img, int threshold) {
  ret bwImageToBinary(new BWImage(img), threshold);
}

static Image2B imageToBinary(BWImage img, double threshold) {
  ret bwImageToBinary(img, zeroToOneToZeroTo255(threshold));
}

static Image2B imageToBinary(BWImage img, int threshold) {
  ret bwImageToBinary(img, threshold);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035420
Snippet name: imageToBinary - extended synonym of bwImageToBinary
Eternal ID of this version: #1035420/4
Text MD5: 9c97d70ed727c4bf0c54033abe326cf2
Transpilation MD5: 6c43e4f7a63aeeadbc217f5a2ff7aac5
Author: someone
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-07 01:36:09
Source code size: 544 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 166 / 231
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)