1 | static RGBImage rgb111(RGBImage rgb) { |
2 | int w = rgb.width, h = rgb.height; |
3 | RGBImage img = new(w, h); |
4 | for y to h: |
5 | for x to w: |
6 | img.setPixel(x, y, rgbPixelTo111(rgb.getInt(x, y))); |
7 | ret img; |
8 | } |
9 | |
10 | static RGBImage rgb111(BufferedImage img) { |
11 | ret rgb111(new RGBImage(img)); |
12 | } |
Began life as a copy of #1015490
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020583 |
Snippet name: | rgb111 - reduce RGBImage colors to 1-1-1 format (8 colors, as a new RGBImage) |
Eternal ID of this version: | #1020583/4 |
Text MD5: | 671bb4896ef3dfdc99ec0b35e81dc364 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-27 17:41:08 |
Source code size: | 296 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 292 / 314 |
Version history: | 3 change(s) |
Referenced in: | [show references] |