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

7
LINES

< > BotCompany Repo | #1034658 // getColor - get pixel from BufferedImage as Color (with alpha)

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

Libraryless. Click here for Pure Java version (5009L/28K).

static Color getColor(BufferedImage img, int x, int y) {
  ret colorFromRGBA(img.getRGB(x, y));
}

static Color getColor(BufferedImage img, Pt p) {
  ret colorFromRGBA(img.getRGB(p.x, p.y));
}

Author comment

Began life as a copy of #1032254

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034658
Snippet name: getColor - get pixel from BufferedImage as Color (with alpha)
Eternal ID of this version: #1034658/1
Text MD5: 164801b5da639139e945448783278eac
Transpilation MD5: 9266edca271b22b61009c5d933ade7ac
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-28 23:13:30
Source code size: 198 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 157 / 218
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1034913 - getIntColorWithoutAlpha - get pixel from BufferedImage as RGB int without alpha