Extra large image manipulation and tiling

I need a software or Java program or method to split very large images (larger than 140 MB). I used ImageMagick and converted Photoshop and Corel Draw and Matlab tools (on Windows), but I have a memory overload problem. ImageMagick is very slow and the result is undesirable. I do not know how I can load a small part of an image into memory without loading the entire image from the hard drive.

+1
source share
4 answers

If you use your own code, libraries such as libjeg give you access to images for scanning - you only need to load 16 scan lines at a time.

0
source

You should take a look at the Java Advanced Imaging API (JAI), which provides built-in support for splitting large images. This is a somewhat complicated API and the documentation is a bit rare, but we used it in the project to view very tall (but narrow) images about 60 mb in size.

Here are some links to get you started:

Process images in Java using JAI

JAI Project Home

0
source

This is not Java, but Inter Performance Primitives (IPP) have many functions for manipulating images that work on tiles. Perhaps you can associate these functions with Java.

0
source

JAI is platform dependent and today seems like a dead project.

I recommend using the open source imagemagick program . Although platform dependent, it is available for the same platforms as JAI, but with full community support.

The focus on large images about imagemagick uses its stream "command instead of convert . Stream only reads the corresponding part of the image and saves the extracted part as raw data. Then you need to" convert "to save small raw data as jpeg.

An example of saving a tile from large.jpeg of size 800x600 from position 0x0 to tile.jpeg:

stream -extract 800x600+0+0 large.jpeg tile.rgb convert -depth 8 -size 800x600 rgb:tile.rgb tile.jpeg 

(When working on Windows, be sure to use ImageMagick convert.exe, as there is a windows command called "convert".)

When working only with TIFF images, apache Sanselan might be the right choice - this is a pure-java image library. Additionally, the JAI seems to contain a platform-independent codec for TIFF.

0
source

Source: https://habr.com/ru/post/1301169/


All Articles