jai

Storing a large image in java - tutorial

痴心易碎 提交于 2019-12-25 07:47:26
问题 I need to save a large image on disk - so large it creates outofmemory errors (like 10000x10000 px). It's suppose to be a tiling and I have the tile stored in memory as a BufferedImage. I read something about TiledImage class being able to work only with part of image, the rest being stored on disk, but I haven't found a simple example of how to do this? Could you please point me to or create a tutorial for dummies on how to store a large image on disk without having it all in memory? Like

Running JAI in OSGi

荒凉一梦 提交于 2019-12-24 13:30:35
问题 I'm trying to run Java Advanced Imaging (JAI) within an OSGi container (spring-dm). I'm able to access the JAI libraries, but receive the following error when I call JAI for the first time: Error: Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode. Occurs in: com.sun.media.jai.mlib.MediaLibAccessor com.sun.media.jai.mlib.MediaLibLoadException The DLLs are on the classpath and referenced as Bundle-NativeCode libraries in my Manifest. Is it possible to run the

ClassNotFoundException javax.media.jai.OperationRegistrySpi but the class is there

自闭症网瘾萝莉.ら 提交于 2019-12-24 08:50:00
问题 I have two similar projects working with Jai and one runs smoothly while the other stops when calling RenderedOp class from the jai_core.jar library, saying that it can't find the class OperationRegistrySpi. Both classes exist within that jar. RenderedOp imagen = JAI.create("stream",imgTif ); //This line throws the exception The log goes like this: GRAVE: >>java.lang.NoClassDefFoundError: javax/media/jai/OperationRegistrySpi >>java.lang.ClassNotFoundException: javax.media.jai

Is there a equivalent of Android's BitmapFactory.Options isDecodeBounds for TIFF in Java/JAI?

有些话、适合烂在心里 提交于 2019-12-23 02:57:17
问题 I am trying to improve the performance of our system (a Java app running in Tomcat) and now the bottleneck is in one operation, we need to read and return dimension of tiff images, so we use JAI's ImageDecoder and use ImageDecoder decoder = ImageCodec.createImageDecoder("TIFF", input, param); RenderedImage r = decoder.decodeAsRenderedImage(); int width = r.getWidth(); int height = r.getHeight(); From sampling data, a lot of time is spent in createImageDecoder. My assumption (without going to

How to use ColorQuantizerDescriptor?

丶灬走出姿态 提交于 2019-12-22 18:45:15
问题 Following the idea of @PhiLho's answer to How to convert a BufferedImage to 8 bit?, I want to use ColorQuantizerDescriptor to convert a BufferedImage , imageType TYPE_INT_RGB, but RenderedOp#getColorModel() is throwing the following exception: java.lang.IllegalArgumentException: The specified ColorModel is incompatible with the image SampleModel. at javax.media.jai.PlanarImage.setImageLayout(PlanarImage.java:541) at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878) at javax

ImageIO support for raw images (jrawio)

妖精的绣舞 提交于 2019-12-22 14:01:31
问题 I was looking for raw image support and found this library (jrawio-1.6.1) which extends imageio to add raw support. It seems to work but awfully slow. I've seen snails that were faster. My code processes Jpegs in seconds and it takes minutes to process a not that much bigger .cr2 file or .nef. I could be wrong but I think it even slowed down the tiff processing. The last tiff file was very big so that could have been the problem too. Another issue I have with this library is that development

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

不打扰是莪最后的温柔 提交于 2019-12-22 08:34:20
问题 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 main(final String[] args) throws IOException { final String imageFile = "/tmp/page0.png"; final BufferedImage pngImage = ImageIO.read(new File(imageFile)); // convert PNG to JPEG // http://www.mkyong.com/java/convert-png-to-jpeg-image-file-in-java/

Public download for javax.media.jai classes?

∥☆過路亽.° 提交于 2019-12-22 06:01:43
问题 This is a pretty simple question... I've been looking for where you can download the javax.media.jai.* libraries. I found the jai imageio libraries... but all the rest of the jai stuff I find is either pretty out of date ( 2008 and before ) and I run into a login screen... Is there a public download for the javax.media.jai stuff anywhere? Thanks for any help in making up for my not so good google-fu on this one... 回答1: Download and FAQ for more info. Maven users should refer to the Using Java

Is JAI closing file handles too early?

痴心易碎 提交于 2019-12-20 05:17:27
问题 I'm using JAI to read Tiff files in java. with this code: RenderedOp renderer = JAI.create("fileload", tifFilename); return renderer.getAsBufferedImage(); Worked fine on one box with java 7, but on others with java 8, get this: Caused by: com.sun.media.jai.codecimpl.util.ImagingException at com.sun.media.jai.codecimpl.ImagingListenerProxy.errorOccurred(ImagingListenerProxy.java:63) at com.sun.media.jai.codecimpl.TIFFImage.getTile(TIFFImage.java:1087) at javax.media.jai.RenderedImageAdapter

Java / JAI - save an image gray-scaled

…衆ロ難τιáo~ 提交于 2019-12-19 22:11:03
问题 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. 回答1: What you want is to download the JAI Image I/O Tools, which provides ImageIO adapters for JAI. Once you've installed that, it's smooth sailing. final BufferedImage in = ImageIO.read(new File("frabozzle.tif")); final BufferedImage out = new BufferedImage( in.getWidth(), in.getHeight(), BufferedImage.TYPE_BYTE_GRAY); out.getGraphics()