Libraryless. Click here for Pure Java version (5895L/41K/146K).
1 | !7 |
2 | |
3 | p {
|
4 | RGBImage img = loadImage(#1006358); |
5 | showImage(new Image332(img).getBufferedImage()); |
6 | |
7 | final new MultiSet<S> histogram; |
8 | for (int rgb : img.pixels) |
9 | histogram.add(to332String(rgb)); |
10 | |
11 | L<S> l = histogram.highestFirst(); |
12 | pnl(lookupToMap(l, histogram.asMap())); |
13 | final int max = histogram.get(first(l)); |
14 | |
15 | printStruct(map from332(l)); |
16 | showImage(mergeImagesVertically(allToRGBImage(map(l, func(S col) { imageFromInt(from332(col), max(1, iround(histogram.get(col)*100.0/max)), 30) }))));
|
17 | } |
Began life as a copy of #1006362
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1010760 |
| Snippet name: | Make 332 color model image histogram [dev.] |
| Eternal ID of this version: | #1010760/20 |
| Text MD5: | 36d5b60544318429d777f068f3263374 |
| Transpilation MD5: | 877c4f74199881a968584edf688e5744 |
| Author: | stefan |
| Category: | javax / imaging |
| Type: | JavaX source code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-10-06 03:16:12 |
| Source code size: | 528 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 670 / 868 |
| Version history: | 19 change(s) |
| Referenced in: | [show references] |