Questions tagged [jai]

The Java Advanced Imaging provides powerful collection of methods for image processing and image analysis for Java.

The Java Advanced Imaging API (JAI) provides a set of object-oriented interfaces that supports a simple, high-level programming model which allows images to be manipulated easily in Java applications and applets. JAI goes beyond the functionality of traditional imaging APIs to provide a high-performance, platform- independent, extensible image processing framework.

See Also - Java Advanced Imaging

310 questions
5
votes
3 answers

How do I save/convert a 24-bit PNG as an 8-bit PNG?

I am creating images using ImageNew (and related) in Railo, which uses JAI under the covers. When I save an image, I'm getting a 24-bit PNG, but I only need 8-bit. (Simply re-saving the file with as 8-bit with a graphics editor results a quarter to…
Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
5
votes
2 answers

Get buffered image from byte array of raw data

I am using JNA. and i am getting byte array of raw data from my c++ method. Now i am stuck how to get buffered image in java using this raw data byte array. I had tried few things to get it as tiff image but i dint get success. this are the code i…
Jony
  • 1,035
  • 7
  • 17
  • 43
4
votes
1 answer

How to combine multiple multi-page tif files into a single tif

I am trying to take multiple multi-page .tif files and combine them into a single multi-page tif file. I found some code in this question, but it only seems to take the first page of each individual .tif file and create the new multi-page .tif with…
twilbrand
  • 1,330
  • 5
  • 19
  • 27
4
votes
2 answers

Help on adding plug-in to Java ImageWriter

I am trying to save a BufferedImage as a PNM file. I already installed the JAI (Java Advanced Imaging), and have the PNMWriter plug-in imported. However, I don't know how to add it to my ImageWriter so it can write in .pnm. When I run…
Pedro Cimini
  • 175
  • 1
  • 1
  • 7
4
votes
1 answer

vectorize polygon using JTS with range lookup

I try to vectorize an image using java i.e. geotools with JAI. The code is minimal and works just fine in intelliJ InputStream stringAsStream = new ByteArrayInputStream(inputAsciiGrid.getBytes(StandardCharsets.UTF_8)); SimpleFeatureIterator…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
4
votes
1 answer

Convert uploaded images from various formats to JPEG

I am developing a website that allows the user to upload images. I would like to be able to accept BMP, GIF, JPEG and PNG (and maybe one or two others like TIFF) formats. I am using the Apache Commons FileUpload library to achieve this. In order…
DanielGibbs
  • 9,910
  • 11
  • 76
  • 121
4
votes
5 answers

java.awt.image.BufferedImage 24-bit RGB to 8-bit Grayscale conversion using custom ColorSpace

I want to do a simple color to grayscale conversion using java.awt.image.BufferedImage. I'm a beginner in the field of image processing, so please forgive if I confused something. My input image is an RGB 24-bit image (no alpha), I'd like to obtain…
mmm
  • 1,277
  • 5
  • 18
  • 34
4
votes
2 answers

Convert a bitmap image to an uncompressed tif image in Java

I'm trying to convert a bitmap image into an uncompressed tif file for use with the Tesseract OCR engine. I can use this method to produce a compressed tif file... final BufferedImage bmp = ImageIO.read(new File("input.bmp")); ImageIO.write(bmp,…
Kingh32
  • 63
  • 1
  • 4
4
votes
1 answer

Convert from Itext PDF byte array to multipage TIFF file

I have a pdf file (obtained from a byte[] generated by iText) I need to send to a signature hardware. Due some incompatibility with the java printer driver I can't send the PDF directly, so i need to convert it to images before. I've succeed…
Jordi Castilla
  • 26,609
  • 8
  • 70
  • 109
4
votes
6 answers

slicing up a very big jpg map image , 49000* 34300 pixel

i want to write a mapviewer, i must to work small tile of big map image file and there is need to tiling the big image, the problem now is to tiling big image to small tiles (250 * 250 pixel or like this size) so on, i used ImageMagic program to do…
sirvan
  • 321
  • 1
  • 8
  • 21
4
votes
2 answers

Convert RGB PNG to CMYK JPEG (using ICC Color Profiles)

I need to convert a PNG-File into a CMYK JPEG. During my research i've found multiple articles on SO decribing that problem. I've copied this answer using BufferedImage and ColorConvertOp. I came up with this little example: public static void…
d0x
  • 11,040
  • 17
  • 69
  • 104
4
votes
2 answers

Java / JAI - save an image gray-scaled

I try to save the tiff instead of coloure gray-scaled. How could I do this? (JAI must be used, because it is a tiff!) Thanks a lot in advance & Best Regards.
Tim
  • 13,228
  • 36
  • 108
  • 159
4
votes
1 answer

Disable Java ImageIO Chroma Subsampling

I'm attempting to save a BufferedImage as JPEG using ImageIO. But even when saving using 100 quality, I am suffering quality loss due to Chroma SubSampling. I have successfully fixed this issue by reverting to the older JAI libraries and explicitly…
ejthurgo
  • 53
  • 1
  • 6
3
votes
1 answer

How can I write 16 bit grayscale image as jpeg?

I have 16-bit per pixel grayscale BufferedImage created from an array of shorts: private BufferedImage get16bitImage(short[] pixels) { ColorModel colorModel = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_GRAY), …
Kcmamu
  • 41
  • 1
  • 4
3
votes
4 answers

Faster performance with TIFF rendering in Java with JAI

I have been working on software that analyzes microscopy data, which is stored as a multilayer tiff file. After looking through StackOverflow and through the JAI documentation, I hobbled together some code to store the tiff stack and render it…
1 2
3
20 21