Questions tagged [javax.imageio]

The Java Image I/O API (the javax.imageio package) contains the basic classes and interfaces for reading/writing BufferedImages and RenderedImages from/to image files and streams.

The Java Image I/O API (the javax.imageio package) contains the basic classes and interfaces for reading/writing BufferedImages and RenderedImages from/to image files and streams.

Many common image I/O operations may be performed using the static methods of the ImageIO class.

The package contains classes describing the contents of image files, including metadata and thumbnails (IIOImage); for controlling the image reading process (ImageReader, ImageReadParam, and ImageTypeSpecifier) and image writing process (ImageWriter and ImageWriteParam); for performing transcoding between formats (ImageTranscoder), and for reporting errors (IIOException).

All implementations of javax.imageio provide the following standard image format plug-ins: JPEG, PNG, BMP, WBMP and GIF.

The javax.imageio package has been available since Java (J2SE) 1.4.

1092 questions
0
votes
1 answer

How to display an image(all major formats), selected by JFileChooser in java

I am developing an image editing app, so want to display an image selected by JFileChooser, so what would be best approach so that it can display all formats jpg, png, gif etc. OpenButton is used for invocation of filechooser. private void…
Tushar Maroo
  • 325
  • 1
  • 5
  • 24
0
votes
3 answers

Uncompress a TIFF file without going through BufferedImage

I am receiving large size CCITT Group 4 compressed TIFF files that need to be written elsewhere as uncompressed TIFF files. I am using the jai_imageio TIFF reader and writer to do that and it works well as long as the product _width * height_ of the…
Gert
  • 220
  • 1
  • 3
  • 13
0
votes
1 answer

Java ImageIO, can't set pixel values?

I have some really simple code that's just not working: int[] manualPixels = new int[width * height * 3]; for (int index = 0; index < manualPixels.length; index++) { if (index % 3 == 2) { manualPixels[index] = 255; } } BufferedImage…
aroth
  • 54,026
  • 20
  • 135
  • 176
0
votes
1 answer

Java - Displaying image using path from JTable

I stumbled upon a problem with my program. What it does: Listens for a row selection in a JTable, uses 'getSelectedRow' to fetch the content of a cell, like so: public void valueChanged(ListSelectionEvent e) { int row =…
Bittein
  • 31
  • 1
  • 6
0
votes
1 answer

ImageIO error when writing to file

I am trying to save a UIImage but it gives me an error. The UIImage is picked from the UIImagePickerController and is then saved by making an NSData out of it and call writeToFile: on this NSData object. When doing so, I will get an error. The same…
simonbs
  • 7,932
  • 13
  • 69
  • 115
0
votes
1 answer

Downloading & saving graphic

I am having difficulties saving pictures that I have loaded. The picture is saved under the same folder where this program is. An error keeps reappearing. The error screen is below Error ---------- Capture Output ---------- >"C:\Program…
Chris Kevorkian
  • 157
  • 1
  • 1
  • 3
0
votes
1 answer

ImageIO.read sometimes retun null even though I am 100% sure the Image is 100% valid

I know the image is valid because I can convert the IplImage to an Image and even draw it on a JPanel. But when I convert a byte array to an Image most of the time I get null reference to an Image. Look at this code below to get a picture what I am…
Daniel Lopez
  • 1,728
  • 3
  • 24
  • 40
0
votes
1 answer

add images to myPanel using ImageIO.read

First I used JLabel and ImageIcon. It worked fine. However, the image doesn't show up when I exported it to JAR. So, then I created my own ImagePanel and used the drawImage method to display it. But it terminates and throws an exception in thread…
kk-dev11
  • 2,654
  • 5
  • 37
  • 48
0
votes
1 answer

Java ImageIO - JPEG blacks changing to gray

I'm using the following code to load a grayscale JPG image, and query a single pixel's value from it: Raster data; data = ImageIO.read (file).getData(); int [] buf = new int[1]; data.getPixel(0, 0, buf); The image I'm using for test purposes is…
Jules
  • 14,841
  • 9
  • 83
  • 130
0
votes
2 answers

Retrieve an image from the web in java

I am trying to read an image that resides somewhere on the web from my Java program. So far I have successfully loaded an image by using the following code. URL url = new URL("http://www.google.com/images/nav_logo4.png"); Image img =…
Savvas Dalkitsis
  • 11,476
  • 16
  • 65
  • 104
-1
votes
1 answer

How to send consecutive images to android phone from computer

I am working on a project. It is about capturing photos from the PC and monitoring them on an Android phone screen. I use JpegEncoder or ImageIO classes from the PC side and on the Android side I use BitmapFactory.decodeStream method. When I send…
daemonThread
  • 243
  • 2
  • 12
-1
votes
1 answer

JavaFX ImageIO.write() doesn't save modified BufferedImage

I'm trying to create an application that lets users modify pictures and then save them. I'm having trouble with the saving part. This is the method that rotates the picture: public void process(ImageView imageView) { if(imageView.getImage() !=…
Bence
  • 109
  • 2
  • 11
-1
votes
1 answer

How to compress jpg and png images in java?

I used ImageIO library and tried to compress Multipart File but if the extension is jpg then it works fine, but when I used png file then it's not working. I got this error while executing this code byte[] byteArr =…
-1
votes
1 answer

ImageIo reading from byte data results in "Empty region!"

I have two services which trade binary data from an original heic/heif image via redis (binary safe). Since ImageIo does not support that image type I built a separate service in nodejs, which just converts heic/heif images to jpegs. After…
-1
votes
2 answers

3D Pictures dont load Java

I tried to show some Blockarts in a 3D Generator. But i cant figure out this error: javax.imageio.IIOException: Can't read input file! at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1310) at Texture.load(Texture.java:20) at…
crvxッ
  • 60
  • 7