Reputation: 18868
I have used this code to get Image into array of pixels.
Now I would like to convert the array of pixels to Image. But when I convert it, I am losing image data.
I can clearly notice some difference between the both images, the Java produced image has some sort of white-noise.
I would like to reproduce the image without single pixel loss of data, how do I achieve in Java?
Upvotes: 1
Views: 1203
Reputation: 111389
The jpg file format uses a lossy compression algorithm which means that the files it generates will have slight differences from the original. You can change the quality setting to compress more or less but you can't save the with its original size without any modifications.
This is why jpg isn't recommended for image editing. Use a lossless format instead, like PNG.
Upvotes: 1