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

10
LINES

< > BotCompany Repo | #1023050 // image332to2bByEqualityToColor

JavaX fragment (include)

1  
static Image2B image332to2bByEqualityToColor(Color color, Image332 img) {
2  
  if (img == null) null;
3  
  int w = img.getWidth(), h = img.getHeight();
4  
  Image2B i2b = new(w, h);
5  
  int reducedColor = to332_int(color);
6  
  for y to h: for x to w:
7  
    if (img.get332Pixel(x, y) == reducedColor)
8  
      i2b.setPixel(x, y);
9  
  ret i2b;
10  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023050
Snippet name: image332to2bByEqualityToColor
Eternal ID of this version: #1023050/1
Text MD5: f6decb13a7363ea6c6d7d66cf50760a8
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-29 14:19:25
Source code size: 332 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 292 / 334
Referenced in: [show references]