Java - I need a very fast image scaling algorithm

浪子不回头ぞ 提交于 2019-11-28 21:40:27

Keep in mind that there's always a trade between speed and image quality when discussing scaling algorithms, and the ideal solution for your case might require some research and testing.

Nearest neighbor is the simplest and fastest implementation of image scaling.

There's a nice intro on image scale/resize on Coding Horror which reviews a couple of techniques and compares their quality.

I imagine you are working with a very small displaying device, so image quality doesn't really matter at the end. Some people are calling this the fastest image scaling implementation for J2ME.

But if you are willing to read some other stuff, this paper presents a low cost (meaning "very fast") algorithm for scaling that significantly improves on nearest neighbor interpolation. There's source code available, and they also present an evolution of that research here.

At last but not least, cvResize() from OpenCV (open source/cross-platform library for image processing). The folks at willow garage are pretty good at making fast procedures for image/video processing, and this function provides a couple of techniques for scaling, so it might be worth to check it's implementation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!