在Java中获取TIFF图像的像素值 [英] Getting the pixel value of a TIFF image in Java

查看:564
本文介绍了在Java中获取TIFF图像的像素值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ImageIO 包不适用于 .tif 图片,我无法创建BufferedImage(Class I'从 .tif 文件中更熟悉)。

The ImageIO package doesn't work with .tif images and I cannot create a BufferedImage (Class I'm more familiar with) from a .tif file.

如何轻松获取TIFF的像素值用Java形象?我怎么能快速完成?

How do I easily get the pixel value of a TIFF image in Java? How can I do it FAST?

我对图像处理没有经验,我会非常感谢一些示例代码!

I'm not experienced with image processing and some sample code would be greatly appreciated!

谢谢!

推荐答案

您将需要Java Advanced Imaging API: JAI 以便使用TIFF图像。

You will need the Java Advanced Imaging API: JAI in order to work with TIFF images.

来自JAI API描述:

From the JAI API description:

TIFF

除基线规格外,编码器和解码器还支持PackBits,修改过的Huffman和CCITT双层编码(传真),JPEG-in-TIFF(根据TIFF技术说明#2)和DEFLATE压缩方案,可以处理具有16位和32位整数样本和32位浮点样本的图像,并且可以读取和写入所有支持的数据类型的平铺图像。解码器还可以解压缩LZW压缩图像。

In addition to the baseline specification, the encoder and decoder support PackBits, modified Huffman and CCITT bilevel encodings (fax), JPEG-in-TIFF (per TIFF Technical Note #2), and DEFLATE compression schemes, can handle images with 16- and 32-bit integral samples and 32-bit floating point samples, and can read and write tiled images of all supported data types. The decoder in addition can decompress LZW-compressed imagery.

将来可能会解决其他功能。

Additional features may be addressed in the future.

通过使用带有TIFF运算符的page参数,可以最轻松地加载多页TIFF文件的单页,该运算符记录在javax.media.jai.operator.TIFFDescriptor的类注释中。此处包含一个代码示例,用于显示使用辅助编解码器类直接加载多页TIFF文件的单页的方法。

A single page of a multi-page TIFF file may loaded most easily by using the page parameter with the "TIFF" operator which is documented in the class comments of javax.media.jai.operator.TIFFDescriptor. A code sample is included here to show a means of loading a single page of a multi-page TIFF file using the ancillary codec classes directly.

尝试其中一些< a href =http://java.sun.com/developer/releases/jai/#jaidemo =nofollow>教程。

这篇关于在Java中获取TIFF图像的像素值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆