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

17
LINES

< > BotCompany Repo | #1010760 // Make 332 color model image histogram [dev.]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (5895L/41K/146K).

!7

p {
  RGBImage img = loadImage(#1006358);
  showImage(new Image332(img).getBufferedImage());
  
  final new MultiSet<S> histogram;
  for (int rgb : img.pixels)
    histogram.add(to332String(rgb));

  L<S> l = histogram.highestFirst();
  pnl(lookupToMap(l, histogram.asMap()));
  final int max = histogram.get(first(l));
  
  printStruct(map from332(l));
  showImage(mergeImagesVertically(allToRGBImage(map(l, func(S col) { imageFromInt(from332(col), max(1, iround(histogram.get(col)*100.0/max)), 30) }))));
}

Author comment

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: 370 / 498
Version history: 19 change(s)
Referenced in: [show references]