Libraryless. Click here for Pure Java version (2607L/16K).
1 | static BWImage img_distanceFromColor(RGBImage img, RGB color) { |
2 | int w = img.getWidth(), h = img.getHeight(); |
3 | int col = color.getInt(); |
4 | BWImage bw = new(w, h); |
5 | for y to h: |
6 | for x to w: |
7 | bw.setPixel(x, y, rgbDiff(img.getInt(x, y), col)); |
8 | ret bw; |
9 | } |
10 | |
11 | static BWImage img_distanceFromColor(BufferedImage img, RGB color) { |
12 | ret img_distanceFromColor(RGBImage(img), color); |
13 | } |
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: | #1024558 |
Snippet name: | img_distanceFromColor |
Eternal ID of this version: | #1024558/2 |
Text MD5: | a04a986b1f114af2f79c7d494c7e6827 |
Transpilation MD5: | dd56c224530e801a2e522880bb7e687a |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-18 13:17:42 |
Source code size: | 398 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 271 / 361 |
Version history: | 1 change(s) |
Referenced in: | [show references] |