用于加载PNG图像的替代库 [英] Alternatives libraries for loading PNG images

查看:134
本文介绍了用于加载PNG图像的替代库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的java J2SE应用程序正在从Web上读取大量(png)图像,其中一些使用诸如真彩色图像(tRNS部分)的透明度颜色等功能,这些功能是Sun的/ Oracle的PNGImageReader实现完全忽略的。

My java J2SE application is reading a lot of (png) images from the web and some of them use features such as a transparency color for true-color images (tRNS section) that Sun's/Oracle's PNGImageReader implementation simply ignores.

因此,通过 ImageIO.read(...); 加载的常见解决方案对我来说不起作用,因为它依赖在这个不完整的PNGImageReader实现上。

Therefore the common solution for loading via ImageIO.read(...); does not work for me as it relies on this incomplete PNGImageReader implementation.

是否有人知道可以正确读取所有形式的PNG图像的png阅读器实现 - 具有颜色表或真彩色和alpha透明度的那些透明色?

Does anybody know a png reader implementation that can read all forms of PNG images correctly - those with color table or true-color and alpha transparency or transparent color?

与GPL项目一样,它应该是非商业性的,可以在应用程序中包含许可问题。

As it is for a GPL project it should be a non-commercial one that can be included without licensing problems into the app.

编辑:我的这个问题太具体了。因此,让我重新设计我的问题:

My be this question was too specific. Therefore let be redesign my question:

谁知道能够加载PNG文件的替代实现和库?

然后,我将测试实现的功能,以加载一些 test png图片

I will then test the implementations for their capabilities to load some test png images.

编辑2:最终结果必须是BufferedImage

The end result have to be a BufferedImage

推荐答案

最后我找到了一个合适的PNG阅读器,完全符合我的需求:

Finally I found a suitable PNG reader which fits my needs perfectly:

Sixlegs Java PNG解码器

主要功能:


  • 开源(LGPL)

  • 正确加载PNG,包括alpha
    透明度和透明色

  • 返回BufferedImage

  • 与其他
    库没有进一步的依赖关系

  • 具有非常小的尺寸(46KB用于整个图书馆)。

  • Open Source (LGPL)
  • Loads PNG correctly including alpha transparency and transparent colors
  • Returns a BufferedImage
  • Has no further dependencies to other libraries
  • Has a very small size (46KB for the whole library).

这篇关于用于加载PNG图像的替代库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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