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

12
LINES

< > BotCompany Repo | #1029771 // combineBWImagesToColor

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

Transpiled version (5323L) is out of date.

1  
static BufferedImage combineBWImagesToColor(BWImage img1, Color color1, BWImage img2, Color color2) {
2  
  int w = img1.getWidth(), h = img1.getHeight();
3  
  int[] pixels = new[w*h];
4  
  int i = 0;
5  
  for y to h:
6  
    for x to w: {
7  
      pixels[i++] = colorToIntOpaque(addColors(
8  
        blendColor(Color.black, color1, img1.getPixel(x, y)),
9  
        blendColor(Color.black, color2, img2.getPixel(x, y))));
10  
    }
11  
  ret intArrayToBufferedImage(pixels, w, h);
12  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1029771
Snippet name: combineBWImagesToColor
Eternal ID of this version: #1029771/2
Text MD5: daeb759b0e646dc8b4c4d2ae9797c10e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-12 03:08:57
Source code size: 460 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 141 / 204
Version history: 1 change(s)
Referenced in: [show references]