Serverside image processing

2019-08-07 02:59发布

I am designing a web application that does server side image processing in real time. Processing tasks include applying different effects like grayscale, blur, oil paint, pencil sketch etc on images in various formats. I want to build it using java/servlets which I am already familiar with. I found 3 options,

1) Use pure java imaging libraries like java.awt or http://www.jhlabs.com/ip/index.html 2) Use command line tools like Gimp/ImageMagick 3) Use c,c++ image libraries that have java bindings.

I don't know which of the above options is good keeping the performance in mind. It looks like option 2) and 3) are good performance wise, but I want to be sure before I rule out 1). I have also heard gimp cannot be run using command line unless gtk or xwindows is already installed on the server. Will there be any such problems with 2) or 3) while running them server side?

Also please suggest any good image processing libraries for this purpose.

11条回答
可以哭但决不认输i
2楼-- · 2019-08-07 03:03

There are many image processing frameworks that you can use in a Java server side applications (J2EE).

Take a look at Marvin. You can setup the project in the same way in a J2SE application. If you are using Tomcat, copy the Marvin folder into the tomcat root and add marvin_version.jar in your project libraries. You can process any image in server side using many algorithms.

In the case of having any problem, use the project Discussion Group or Google about how to use Marvin in a J2EE application.

An stackoverflow post about running Marvin on server side: Adding MarvinFramework to a WebApp on Tomcat7

查看更多
不美不萌又怎样
3楼-- · 2019-08-07 03:04

Just to complicate things, the GIMP has an API, with a Java wrapper: JGIMP.

查看更多
Rolldiameter
4楼-- · 2019-08-07 03:06

You should look into the image processing in the Java2D package and if at all possible run on a Windows box with a suitable graphics card as Java can use it to accelerate the Java2D operations.

查看更多
相关推荐>>
5楼-- · 2019-08-07 03:13

If you own the servers, the best possible option is to install a big fat GPU or two and use some GPU accelerated libraries to do your image processing. In my own simple image processing code in CUDA (image rotation), I get more than 100x speedup over the CPU with a Geforce GTX-285 (240 core GPU)

查看更多
萌系小妹纸
6楼-- · 2019-08-07 03:20

@WizardOfOdds: If I understand you right, we need to have xvnc to run softwares that aren't supposed to run headless. But the point is unless we have xvnc already on the hosted env or we have enough rights to install xvnc, we still can't run softwares that require full graphical environment on the machine. I thought this was the case with most hosted environments (except the dedicated server they provide where you have full control). Correct me if I am wrong.

查看更多
兄弟一词,经得起流年.
7楼-- · 2019-08-07 03:21

I can recommend to use C++ libraries and interface from Java with them. One option for example is Intel Performance Primitives, that are optimized for SSE instructions and multicore. For some operations this can be in order of magnitude faster. IPP include highly optimized functions for most of the basic operations like: blur, color conversion, different filters, etc.

查看更多
登录 后发表回答