jai

Round corners on images using Java and JAI

China☆狼群 提交于 2019-12-11 09:56:59
问题 We're using JAI (https://jai-imageio.dev.java.net/) to scale and crop images in Java. We would like to create round corners on our images. How do we do that? The images are JPG and PNG. I would think it's easier to do this with JPGs? The image is a PlanarImage from JAI PlanarImage src = JAI.create(...,...); which can be transformed to a java.awt.Graphics object Has anyone done this before? 回答1: PNG supports a transparent alpha channel, but JPG does not. So, for JPG you would have to also pick

Java plugin (JAI) automatic installation

99封情书 提交于 2019-12-11 09:15:41
问题 I was wondering if anyone has any experience getting JAI to auto install from an applet for multiple platforms. I've looked at http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/extensions.html#specifying And it seems to imply (by the fact nothing to the contrary is mentioned) I can only specify an single platforms installer. e.g. Extension-List: jai_core jai_core-Extension-Name: javax.media.jai jai_core-Specification-Version: 1.1-mr jai_core-Implementation-Version: 1.1.3 jai

JAI: How to convert 4-band 32-bits CMYK image into PNG?

拟墨画扇 提交于 2019-12-11 04:48:32
问题 I'm trying to convert a image into PNG format, the data I have is a 4-band 32-bits TIFF-like image compressed by LZW. By using Java2D and JAI now I have data uncompressed to represent colors in CMYK space and it can be exported and viewed when stored in tiff with the same settings as 4 band 32-bit format. The problem is when I try converting to other formats like PNG it produce zero-sized data, so I'd like to ask is there anyone have similar experience on converting such image? I have some of

How to read a TIFF file by tiles with Java?

蓝咒 提交于 2019-12-10 13:54:54
问题 Let's say I have a very large TIFF image as input. I am not able to load this image entirely because of memory specification I must comply with. So the following is not an option : BufferedImage data = ImageIO.read(image); Is there any Java library allowing to read a specific part of the image without buffering the whole image ? Or some ways to get TIFF tiles from a stream ? 回答1: ImageIO can provide you an ImageReader for Tiff, and then you can use readTile. ImageIO has several

Get buffered image from byte array of raw data

泄露秘密 提交于 2019-12-10 10:23:24
问题 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 tried so far. here my byte array contains data for 16 bit gray scale image. i get this data from x-sensor device. and now i need to get image from this byte array. FIRST TRY byte[] byteArray = myVar1.getByteArray(0, 3318000);//array of raw data

“JRE 1.3 or higher must be installed!” / “JDK 1.3 or higher must be installed!” errors installing JAI 1.1.3 on Windows 7 (x64)

為{幸葍}努か 提交于 2019-12-08 17:39:58
问题 I am getting these errors... Severe: JRE 1.3 or higher must be installed! Severe: JDK 1.3 or higher must be installed! ...when installing JAI (Java Advanced Imaging) 1.1.3 on Windows 7 (x64), with JRE 7 (1.7) installed at "C:\Program Files\Java\jre7" and JDK 7 (1.7) installed at "C:\Program Files\Java\jdk1.7.0". Following http://download.java.net/media/jai/builds/release/1_1_3/INSTALL.html#Windows, specifically this is what I did: Visited: http://download.java.net/media/jai/builds/release/

Anyone have any luck writing a very fast tiff viewer/editor in Java?

两盒软妹~` 提交于 2019-12-08 12:50:59
问题 I have explored several leads (sample apps) in the JAI/ImageIO arena, and have so far come up lacking in performance. It may just be that Java is not the platform for fast viewing/scaling/editing of tiff files. I am looking to produce performance similar to Irfanview, but so far haven't found what I am looking for. JAI\ImageIO seems possible - but there seems to be many variations in how one can load/scale/display the images (in so far as performance is concerned). Anyone have any luck or

Printing a .TIF file

徘徊边缘 提交于 2019-12-08 12:22:53
问题 I am able to print a .GIF, .JPG or .PNG successfully using the following code snippet but it doesn't work for .TIF file. Also I can't get the color even after adding the chromaticity.color attribute. public class PrintImage { static public void main(String args[]) throws Exception { PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet(); pras.add(new Copies(1)); pras.add(chromaticity.color); PrintService pss[] = PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.GIF,

How to add GPS metadata to TIFF in Java?

那年仲夏 提交于 2019-12-07 17:09:27
问题 I am attempting to add GPS data to a TIFF file I am creating in Java. I am using the JAI-ImageIO libraries, although if there is a better library for doing both GPS metadata and custom metadata, I am willing to look into it. I have attempted to add the GPS metadata to the nodes directly, but it seems to strip off the GPS IDF tag. I have attempted to add the GPS IFD to the TIFFIFD object (from the TIFFIMageMetadata object), but that doesn't seem to save the data properly. Basically, I am

Convert a bitmap image to an uncompressed tif image in Java

自闭症网瘾萝莉.ら 提交于 2019-12-07 09:04:34
问题 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, "jpg", new File("output.tif")); This produces an empty tif file when the "jpg" is changed to tif as these files are dealt with in Java Advanced Imaging (JAI). How can I create an uncompressed tif image? Should I decompress the tif image produced from