Java BufferedImage getting red, green and blue individually
The getRGB method returns a single int. How can I get individually the red, green and blue colors all as values between 0 and 255? ...
The getRGB method returns a single int. How can I get individually the red, green and blue colors all as values between 0 and 255? ...
Hi there. I noted that when i draw something with Color(0,0,0,0), which is over another image, the color shown is the JFrame background, not the image just below it. Reasons that'd help me to find a solution? Thanks!! Edit: See the circles, the grey area (corners) should be transparent but are not, instead, they are the color of the J...
I have checked similarly named questions, but they don't answer this use case. Basically, I was to overlay some text (text) at a given coordinate (x,y) I have the below function in a package; protected BufferedImage Process2(BufferedImage image){ Graphics2D gO = image.createGraphics(); gO.setColor(Color.red); gO.setFont(new...
Hi everyone! I need to translate colors in bitmap loaded to BufferedImage from RGB to YCbCr (luminance and 2 channels chrominance) and back after process. I made it with functions used like rgb2ycbcr() in main method for each pixel, but it isn't so smart solution. I should use ColorSpace and ColorModel classes to get BufferedImage with...
I posted a question in sun java forums sometime ago and i am finding it hard to understand the first response i received from the replier though it seems he gave me the correct approach to my problem. The link to the question is: http://forums.sun.com/thread.jspa?threadID=5436562&tstart=0 Someone replied that i should use Buffered...
I have created a a bufferedImage of 6 tiles of 2 rows and 3 columns and i want to rotate the last tile of the second row. This tile serves as a crossing for my animation. My problems are : How can i get access to that specifc tile alone and rotate it alone without affecting others. I have googled for a while but no answer. ...
I want to do a copy (of a rectangle area) of the ARGB values from a source BufferedImage into a destination BufferedImage. No compositing should be done: if I copy a pixel with an ARGB value of 0x8000BE50 (alpha value at 128), then the destination pixel must be exactly 0x8000BE50, totally overriding the destination pixel. I've got a ve...
Hi! I'm working for the first time with images in a JFrame, and I have some problems. I succeeded in putting an image on my JFrame, and now i want after 2 seconds to remove my image from the JFrame. But after 2 seconds, the image does not disappear, unless I resize the frame or i minimize and after that maximize the frame. Help me if you...
I have a collection of BufferedImage instances, one main image and some subimages created by calling getSubImage on the main image. The subimages do not overlap. I am also making modifications to the subimage and I want to split this into multiple threads, one per subimage. From my understanding of how BufferedImage, Raster and DataBu...
Hi friends, I'm having problem with some framework API calling BufferedImage.getGraphics() method and thus causing memory leak. What this method does is that it always calls BufferedImage.createGraphics(). On a windows machine, createGraphics() is handled by Win32GraphicsEnvironment which keeps a listeners list inside its field display...
I need to create a grayscale image from data in an nio ShortBuffer. I have a function that maps the data in the ShortBuffer to unsigned byte but is in an int (easily changed). The method I found uses an RGB plus transparency color model and appears to be quite inefficent. i have not been able to see how to apply the TYPE_BYTE_GRAY and...
hello i have a heavy graphics application where i have to draw the graphics in 2-10 seconds every time this time varies depending upon the source application which is sending data to my application via UDP; i have some static graphics there is no change in them some are semi dynamic that means some time they are updated and normally rem...
Hello Guys, I am trying to rotate a tile in a BufferedImage(the bufferedimage is made up of tiles) but i got stuck and don't seem to find the answer. I have googled for hours but can't find any tutorials. So i decided to come here for help. I want to rotate the crossing(tile) at the bottom right of the buffered image. I want to rotate...
All, I'm doing some image manipulation in Scala by making use of BufferedImages and Raster objects. I am attempting to get all the pixels in the buffered image with the following code. val raster = f.getRaster() // Preallocating the array causes ArrayIndexOutOfBoundsException .. http://forums.sun.com/thread.jspa?threadID=5297789 // R...
I am attempting to create a mosaic of images in Java. I calculate the size of the new image I'm creating, and then for each subimage that will be part of the mosaic, I do a paint call. In pseudocode: create buffered image big enough to hold entire mosaic create Graphics2D context from that image for each buffered subimage that will...
sorry to disturb again but i like learning here. i am using JHLabs library on filters for buffered images.on running my code i am getting this exception:L java.lang.ArrayIndexOutOfBoundsException: 4 at com.jhlabs.image.ConvolveFilter.convolveHV(ConvolveFilter.java:175) at com.jhlabs.image.ConvolveFilter.convolve(ConvolveFilter.j...
I was wondering if it would be possible to recognize that a BufferedImage in java is a blank (invisible for a user in a browser) image. ...
Is there any faster way to achieve padding of pixels to a BufferedImage than drawing it centered on larger BufferedImage? ...
I am trying to port some code from a regular java program into the android platform. Unfortunately, a significant part of the program involves manipulating images, and java's awt was taken away from me. I am trying to replace awt.BufferedImage with a Bitmap, and was hoping that the only differences between the two classes would be their ...
Hi guys , I need your help please. I have spent hours trying to solve it but not working. I have an image i am rotating when the user clicks on a button. But it is not working. I would like to see the image rotating gradually till it stops but it doesn't. This it what it does. After i click the button, i don't see it rotating. But wh...