Pixel image processing: use your own APIs or third-party libraries?

I need to write a Java application that should be able to manipulate image pixels regardless of image format ( JPEG , BitMap , Gif , ...).

This means that I need to access the pixels, and I also need to calculate some image attributes, such as size , resolution , contrast , brightness and compression algorithm .

I also need to manipulate the bits of individual pixels. Now I need to know that I can do this with pure Java SE classes , or do I need to use a third-party library? If so, which is better for me? JAI, ImageJ, ...?

+4
source share
1 answer

Take a look at the Java Advanced Imagining API FAQ and you must decide if you want to use your own Java APIs or a third-party library. (The concept of pixel manipulation can vary greatly in complexity. The examples you provided are not complicated, but there may be other operations.) Obtaining the size, resolution and compression of alg is somewhat trivial, since all the attributes of the objects that you use when manipulating images, (Although the resolution relatively.) Working with contrast and brightness is a bit more, but not very much. See here for an interesting example . Java2s has many image fragments available for working with Java images.

Here is a link directly to the Supported File Formats section of the FAQ.

JAI Hello World:

PlanarImage source = JAI.create("fileload", file); 

This function automatically determines the file format and creates an image object that can be displayed or processed.

+4
source

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


All Articles