Might be relevant. I've just noticed that what one creates the
then
FileImageOutputStreamSpi creates
javax.imageio.stream.FileImageOutputStream, which in turn does
new RandomAccessFile(f, "rw") and that does not overwrite / truncate the output file, but re-uses it. That means
TIFFImageWriter writes to it up to necessary position, but the trailing "junk" stays there. Which means that if you write in your
test scenario to the
same output file, and by chance started with uncompressed scenario, then filesize will not change and will stay the same but modification time changes.
If that is not your case, then I would say that LZW (lossless compression) generally cannot be better than JPEG (lossy). Also, what do you refer as "Original image"?
You should refer raster as original image, e.g. try to write to TIFF without compression – that will be your baseline.