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

Converting byte array to png

I have a byte array obtained from an image using the following code. String path = "/home/mypc/Desktop/Steganography/image.png"; File file = new File(path); BufferedImage bfimage = ImageIO.read(file); ByteArrayOutputStream baos = new…
0
votes
1 answer

How to convert a byte array into a PNG image?

How can I convert an array of bytes to a PNG image (not a JPEG)? I know that the process requires a conversion to BufferedImage as a step. I encountered this problem while coding for steganography.
0
votes
1 answer

Why is my BufferedImages not overlapping correctly?

I am trying to write a little beginner program that will just display a couple of BufferedImages that you can move around and put on top of each other. I am having trouble however to get the images on the screen to overlap correctly. I want the…
user5846939
  • 415
  • 4
  • 11
0
votes
1 answer

java bufferedimage array data immediately changes

import javax.imageio.ImageIO; import org.bytedeco.javacv.FFmpegFrameGrabber; public class FrameData { int count = 0; int picWidth; int picHeight; BufferedImage img = null; //GET FRAME COUNT public int gf_count(int…
ken
  • 3
  • 3
0
votes
0 answers

Using Graphics to Draw a BufferedImage with AlphaBlending Java

I do a lot of game programming in my free time, and am currently working on a game engine library. Previous to this point I have made customized per game engines built straight into the application, however, to challenge my logical skills even…
CraigR8806
  • 1,584
  • 13
  • 21
0
votes
1 answer

How to increase the size(height and width) and DPI of a tiff image

Input image Output Image I am merging a group of tiff images into one and at the same time want to resize/rescale the final tiff image in java . Is there a way to do that . Below was my logic for merging . I am successfully in merging but can't…
User146378
  • 215
  • 1
  • 3
  • 11
0
votes
0 answers

How to Serialize and Send BufferedImage

Currently I am trying to send a BufferedImage in Java. I am aware that BufferedImage isn't serialize, so I tried to create a serializable version. Here is the code to that: import java.awt.image.BufferedImage; import java.io.IOException; import…
dsiegler19
  • 369
  • 1
  • 5
  • 20
0
votes
2 answers

How to get a BufferedImage of a File that is not a .jpeg, .gif, .bmp, or .png

In Java is there any way to get a BufferedImage of a File that isn't a .jpeg, .gif, .bmp, or .png? More specifically, I would like to be able to create a BufferedImage .jpg. The only way I know of is ImageIO.read, which will return null if the file…
dsiegler19
  • 369
  • 1
  • 5
  • 20
0
votes
1 answer

BufferedImage won't show

I've been trying to create a JPanel with a BufferedImage in it, the paintComponent method runs and compiles along with the constructor code that initialises the BufferedImage. Still, nothing's showing in the JFrame when I run the GUI. Any ideas?…
0
votes
1 answer

Java, image is changing to wrong rgb values

i wrote a java code to change all the red values of a black and white image to 255, so the output would be a red image. But its not red, instead it outputs a brighter image. What did I do wrong? File bwgFile = new…
ergoforce
  • 17
  • 5
0
votes
1 answer

ScrollPane with BufferedImage is not scrolling

I am making program which will show zoomed in picture in scrolled frame and allow user to change single pixels of buffered image. I am trying to add panel with buffered image to scrolledPane but scroll bars wont appear. Here is my panel: package…
Max
  • 59
  • 1
  • 12
0
votes
3 answers

How do I properly create a BufferedImage from file?

I have this code: package test; import javax.imageio.ImageIO; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.WindowConstants; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.File; import…
Ethan JC Rubik
  • 174
  • 1
  • 1
  • 12
0
votes
2 answers

BufferedImage black and white after scaling

After scaling BufferdImages of nation flags about 50% of all flags are displayed in black and white (not grayscale) and few do look weird, like turky: Here's a black and white example Here I set the flag protected void updateFlag(BufferedImage…
Aeron
  • 29
  • 4
0
votes
3 answers

Image actualization in JAVA after pixels are changed

I have such problem: I have prepared in JAVA program that is supposed to save some data from picture and save them into txt file. Then the program is supposed to change into black all pixels of the picture in each 25th row and actualize the picture…
vonski
  • 7
  • 1
  • 6
0
votes
1 answer

How to draw a sector of a BufferedImage?

I'm making a game with a mouse cursor, and I'd like to represent the health by overlaying the cursor with a green version of the image, but only a geometric sector of it corresponding to the health percentage. Solutions from posts like these:…
Ryguy9999
  • 13
  • 4
1 2 3
99
100