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

java creating a BufferedImage and taking a subimage from it

I want to be able to get a BufferedImage from a URL / a File and then return a subimage from it. The first issue is that when i try it with BufferedImage b = null; b = ImageIO.read("url"); b just stays null. Can anyone explain to me how to…
Toreole
  • 33
  • 1
  • 10
0
votes
1 answer

Java- Output not printing

I'm trying to convert an image file to Base64 string using BufferedImage class. Even though the code is not giving any compilation/run time errors the output is not getting printed in the console. Eclipse IDE code: public class BufferImage { public…
Lucy
  • 1,812
  • 15
  • 55
  • 93
0
votes
0 answers

Java | Buffered Image working But Not How I Want and Keybindings doing the same

Background Stuff So I have been working on a Java game for the past 3-4 weeks for a class final project. What it is supposed to do is generate a "map" that the player has to navigate through to get to the "exit" in the bottom right corner (shown as…
0
votes
1 answer

BufferedImage not clickable

I'm currently having trouble making a BufferedImage into a clickable object. I'd like the user to be able to click the image which is in its own class, and then painted via drawImage. Can anyone give me any support in making this happen? Also is it…
0
votes
1 answer

How to draw a sprite with bufferedimage

I've made a spritesheet and have one sprite on there. But I want to display that sprite. I got the main class(called Game), a Sprite class, a SpriteSheet class, an Entity class and an Enemy class. In the main class I've got the main game loop(It's…
Tom
  • 39
  • 1
  • 6
0
votes
0 answers

Zooming an Image by bilinear Interpolation method in java

I am trying to read an image, zoom it in to 80*60 and then zoom out the resulted image 5 times by bilinear Interpolation method. But I get this error : Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4800 . Can anyone help me…
0
votes
2 answers

Zooming an image in java by Repication Method

I am trying to read an image, zoom it in to 80*60 and then make it duplicated in size by replication method. My methods work well individually, but when when I call them in the main method my image turns black. Can anyone help me please? Here is…
Nazi
  • 61
  • 10
0
votes
0 answers

Fast way to convert BufferedImage to Jpeg

i'm trying to stream a camera feed over the network, the main problem that i encountered is the ImageIO latency to encode BufferedImage to jpg Here is my code: long cameraTimer = 0, cameraTimerFPS = 0, cameraFPS = 0, cameraSize = 0; while…
Emax
  • 1,343
  • 2
  • 19
  • 30
0
votes
0 answers

ArrayList of BufferedImage and info in HttpServletResponse

I have a servlet that has an ArrayList of BufferedImage and some information for every item, how may I pass them in HttpServletResponse? I'm able to pass only one image with OutputStream out = response.getOutputStream(); BufferedImage buf_img =…
xcsob
  • 837
  • 1
  • 12
  • 27
0
votes
2 answers

Java, Image turns black after resizing File in Java

Image turns black after resizing MultipartFile in Java .. I am trying to save file in sql db.. I need to down image quality and size because of memory..after resizing it gets black .. any ideas? private static int IMG_HEIGHT = 1280; private static…
user3414260
  • 257
  • 2
  • 6
0
votes
1 answer

Is there a faster way of iterating through pixels of BufferedImage in java?

I have a program that requires going through BufferedImages pixel by pixel quite often. Normally efficiency wouldn't matter enough for me to care, but I really want every millisecond I can get. As an example, right now, the fastest way I've found of…
user3236716
  • 189
  • 1
  • 11
0
votes
2 answers

Java writing png file makes everything transparent

I am currently trying to save a BufferedImage to a png file: for(int x = left.getBlockX(); x < (left.getBlockX() + height); x++){ for(int z = left.getBlockZ(); z < (left.getBlockZ() + width); z++){ pixels[i] =…
Lucas Romier
  • 1,291
  • 1
  • 13
  • 22
0
votes
2 answers

How can i add a "Player image" into Java?

Right, i am working on a new 2d/top down Java game. Recently, i have been teaching myself how to code in Java however i do have one problem... I have a box in my window which i am able to move around with the W,A,S AND D keys. All i want to know is…
user6088042
0
votes
1 answer

websocket api - image encoding yields no image type on client side

I have a web socket server on tomcat 8 with the following binary use: sess.getBasicRemote().sendBinary(bf); where bf is a simple image to bytes conversion as follows: BufferedImage img = ImageIO.read(...); ByteArrayOutputStream baos = new…
0
votes
2 answers

Using a BufferedImage to draw the Mandelbrot set, only getting a solid color

I'm writing a Java program to display the Mandelbrot set for my introductory programming class. I believe I've got all of the math set up correctly, however when I attempt to draw the fractal I end up getting just a solid color. I've tested the math…
1 2 3
99
100