Sanselan 是一个纯 Java 的图形库,可以读写各种格式的图像文件,包括快速解析图片信息例如大小/颜色/icc以及元数据等。尽管因为是Java开发的,在处理速度上会稍微慢一 些,但具备良好的可移植性。虽然尚未发布1.0 版本,但是已经有多个项目在使用 Sanselan 来处理图像文件。
该项目目前还是 Apache 组织的一个孵化项目。
JavaDoc: http://www.apache.org/dist/incubator/sanselan/javadoc/
示例代码:
File file = someFile;
BufferedImage image_3 = Sanselan.getBufferedImage(file);
InputStream is = someInputStream;
BufferedImage image_4 = Sanselan.getBufferedImage(is);
// Write an image.
BufferedImage image = someImage;
File dst = someFile;
ImageFormat format = ImageFormat.IMAGE_FORMAT_PNG;
Map optional_params = new Hashtable();
Sanselan.writeImage(image, dst, format, optional_params);
OutputStream os = someOutputStream;
Sanselan.writeImage(image, os, format, optional_params);
// get the image's embedded ICC Profile, if it has one.
byte icc_profile_bytes[] = Sanselan.getICCProfileBytes(imageBytes);
ICC_Profile icc_profile = Sanselan.getICCProfile(imageBytes);
// get the image's width and height.
Dimension d = Sanselan.getImageSize(imageBytes);
// get all of the image's info (ie. bits per pixel, size, transparency, etc.)
ImageInfo image_info = Sanselan.getImageInfo(imageBytes);
if (image_info.getColorType() == ImageInfo.COLOR_TYPE_GRAYSCALE)
System.out.println("Grayscale image.");
if (image_info.getHeight() > 1000)
System.out.println("Large image.");
// try to guess the image's format.
ImageFormat image_format = Sanselan.guessFormat(imageBytes);
image_format.equals(ImageFormat.IMAGE_FORMAT_PNG);
// get all metadata stored in EXIF format (ie. from JPEG or TIFF).
// org.w3c.dom.Node node = Sanselan.getMetadataObsolete(imageBytes);
IImageMetadata metdata = Sanselan.getMetadata(imageBytes);
// print a dump of information about an image to stdout.
Sanselan.dumpImageFile(imageBytes);
// get a summary of format errors.
FormatCompliance format_compliance = Sanselan
.getFormatCompliance(imageBytes);
http://www.oschina.net/p/sanselan/similar_projects?lang=22&sort=view
相关推荐
sanselan-0.97-incubator图像处理库jar包及源码。Sanselan 是一个纯 Java 的图形库,可以读写各种格式的图像文件,包括快速解析图片信息例如大小/颜色/icc以及元数据等。
Apache Commons Imaging(以前称为 Sanselan)是一个纯 Java 图像库。 文档 更多信息可以在。 可以浏览 。 与 Apache Commons Imaging 的使用相关的问题应该张贴到。 我在哪里可以获得最新版本? 您可以从我们的...
Sanselan 是一个纯 Java 的图形库,可以读写各种格式的图像文件,包括快速解析图片信息例如大小/颜色/icc以及元数据等。尽管因为是Java开发的,在处理速度上会稍微慢一 些,但具备良好的可移植性。虽然尚未发布1.0 ...
org.apache.sanselan.ImageInfo img = Sanselan.getImageInfo(file); if(img.getColorType() == org.apache.sanselan.ImageInfo.COLOR_TYPE_CMYK) { //这家伙是cmyk模式滴 back = true; } } ...
可以读取图片EXIF信息,支持多种图片格式.
sanselan-0.97-incubator.jar sanselan-0.97-incubator.jar
Sanselan是一个纯Java的图形库,可以读写各种格式的图像文件,包括快速解析图片信息例如大小/颜色/icc以及元数据等。
NULL 博文链接:https://wangrusheng5200.iteye.com/blog/470252
开发中经常遇到java.lang.NoClassDefFoundError等问题,为用到这里的jar包
辨别图像格式,分辨率,像素,备注等信息 Get file format, image resolution, number of bits per pixel and optionally number of images, comments and physical resolution from JPEG, GIF, BMP, PCX, PNG, IFF, ...
apache-sanselan-incubating-0.97-bin; commons-beanutils-1.8.3-bin; commons-collections-3.2.1-bin; commons-dbcp-1.4-bin; commons-dbutils-1.4-bin.tar; commons-io-2.3-bin; commons-lang3-3.1-bin; commons-...
当前,该库提供了足够的功能,可以使用蜡染将svg文件转码为图像。 演示 请记住:此软件是实验性的 这意味着它可能对您不起作用! 欢迎您尝试,但目前不会提供任何支持。 如果您想帮助开发,请这样做! 目前的一些...
// 获取ImageMetadata对象实例 ImageMetadata metadatas = Imaging.getMetadata(file); // 强转为JpegImageMetadata JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadatas; // 获取...
apache commons jar(commons所有的jar包... apache-sanselan-incubating-0.97-bin bcel-5.2 commons-beanutils-1.9.2-bin commons-chain-1.2-bin commons-cli-1.3.1-bin commons-codec-1.10-bin commons-collections4-4
apache-sanselan-incubating-0.97-bin.zip bcel-5.2.zip bsf-bin-2.4.0.zip commons-attributes-2.2.zip commons-beanutils-1.8.3-bin.zip commons-betwixt-0.8.zip commons-chain-1.2-bin.zip commons-cli-1.2-bin....
apache-sanselan-incubating-0.97-bin bcel-5.2 commons-beanutils-1.9.2-bin commons-chain-1.2-bin commons-cli-1.3.1-bin commons-codec-1.10-bin commons-collections4-4.0-bin commons-configuration-1.10-bin ...