Questions tagged [bufferedimage]

The Java class BufferedImage is used to read and manipulate images and assist in double-buffering in desktop GUI applications.

The java.awt.image.BufferedImage Java class is part of the Abstract Windowing Toolkit group of classes that form part of the standard JDK.

The BufferedImage class contains methods to manipulate pixel values and is also used for double-buffering in applications that have a Java Swing GUI.

2150 questions
0
votes
1 answer

Out of bounds exception in getSubimage() method

I have made a small piece of code to split spritesheets into seperate images... private BufferedImage sheet, dirt, grass, rock, tree, water; int width = 64, height = 64; public void split() { dirt =…
Kakarot117
  • 21
  • 2
0
votes
0 answers

Display multiple images using ImageIO and ByteArrayOutputStream

I'm trying to display multiple images from a directory using ImageIO and ByteArrayOutputStream. For one image I can do this easily: public byte[] getImage() { try { InputStream inputStream = new FileInputStream("image.jpg"); …
mdp
  • 171
  • 1
  • 1
  • 8
0
votes
0 answers

Java fillOval precision

I'm a java novice and currently developing a game like snake, with multiple snakes. The snake object has - among others - (x,y) coordinates, where a circle is painted by fillOval, using Timer. My problem is, I need to check for collision. The idea…
a_mester
  • 13
  • 1
0
votes
1 answer

Implement Sobel Algorithm

I want to implement Sobel algorithm. First I get gray data of the input image and put data into mGrayData: BufferedImage mImage, mNewImage; for (int i = 0; i < mHeight; i++) { for (int j = 0; j < mWidth; j++) { int rgb =…
CoXier
  • 162
  • 1
  • 10
0
votes
1 answer

sun.awt.image.ByteInterleavedRaster.setPixels

Now I am learning about Image.I want to copy an image. I try: private BufferedImage mImage, mNewImage; private int mWidth, mHeight; private int[] mPixelData; public void generate() { try { mImage = ImageIO.read(new…
CoXier
  • 162
  • 1
  • 10
0
votes
2 answers

Multiplying Pixel Values in BufferedImage results in strange Behaviour

I am currently working on a program to help photographers with the creation of timelapses. It calculates an decline or rise in brightness over a series of images. So the change in Exposure and iso for example dont affect the overall decline in…
I4k
  • 5
  • 2
0
votes
1 answer

Java application getting launched when trying to generate a thumbnail from a image byte array

Code: public byte[] getThumbnail(byte[] imageBytes) throws Exception { ByteArrayInputStream inputStream = new ByteArrayInputStream(imageBytes); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); …
0
votes
0 answers

converting emf image to BufferedImage

I have a single threaded code to convert emf to BufferedImage to png. So I expect all runs of the code to result in exactly same png for a given input. But my png's vary slightly mostly along the thin shape paths (look at the third chart in images 1…
0
votes
1 answer

JSP display image in html after generating BufferedImage

I have a java class generating an image from a random String, the java code works fine when I run individually and the image is being save in the local directory. Now I created a simple JSP form for registration, how do I display out the image in…
Tommy Yap
  • 85
  • 1
  • 9
0
votes
2 answers

Java Images take up too much memory

I have a program that uses a lot of images. It loads alot of images from file, and stores them so they are only loaded once. It also creates multiple BufferedImages, about 400x400, there would be no more than 10 of these. The images from file total…
DanielGibbs
  • 9,910
  • 11
  • 76
  • 121
0
votes
0 answers

How to read from the default frame buffer after binding and unbinding an FBO with JOGL

I use frame buffer objects in a JOGL application to do many things, from shadow maps to picking, and everything works as expected. However, as soon as I bind and unbind an FBO, errors are thrown when trying to get a screenshot of the default frame…
KJTdev
  • 1
  • 2
0
votes
1 answer

Send email image Bufferedimage/ImageIO

I am trying to convert base64 image to a file that can be seen on gmail/outlook. Currently when I send an email with an image to my existing gmail, the image disappears, I can see all the text except for the image. But I can view the image in my…
mary
  • 71
  • 1
  • 1
  • 6
0
votes
1 answer

Write text to image in multiple fonts with wrapping in java

I am trying to create an image with a given text and style. eg; " textStyle(Offer ends 25/12/2016. Exclusions Apply., disclaimer) textStyle(See Details,underline) " In above line i am splitting and creating a map that stores the first parameter of…
user973179
  • 21
  • 7
0
votes
1 answer

Store thousands of BufferedImages in ArrayList without using up all memory - Java

I am trying to make a screen recording app. I have code that takes a screenshot using java.awt.Robot.createScreenCapture and then stores the output in an arraylist. The arraylist needs to store 7500 images. I need to be able to access any of the…
XMB5
  • 1,384
  • 1
  • 13
  • 17
0
votes
1 answer

Webelement screenshot error

With the below code i try to capture the screenshot of WebElement with selenium webdriver. WebElement ele1 = driver.findElement(By.xpath("//*[@id='main']/div[2]/div/div[2]")); File screenshot1 = ((TakesScreenshot)…
Eliyas
  • 177
  • 1
  • 11