You can use JDeli to achieve image color inversion in Java. JDeli is an enterprise-level Java image library that makes it easy to read, write, convert, manipulate and process HEIC and other image file formats in Java.
This class uses the provided image and returns an inverted image containing negative argb values image. This makes the image appear inverted.
ImageProcessingOperations operations = new ImageProcessingOperations();
// You can chain several operations here such as scale, blur, etc