I cannot say that it is the "best" library, but I think you can try this: http://algart.net/java/AlgART/ It is an open-source Java library, supporting generalized "smart" arrays and matrices with elements of different types (from 1 bit to 64-bit floating point), including 2D-, 3D- and multidimensional image processing and other algorithms, working with arrays and matrices. Unfortunately right now it consists not enough demo and examples, but, on the other hand, it contains a lot of JavaDocs. It lay in the base of commercial software (SIMAGIS) during several years, but now it is open-source.