Open fuzzah opened 2 months ago
Mat2 removes metadata from images by running them through pixbuf.savev, which opens and saves the image without any metadata. As a consequence, it compresses the image, mat2 doesn't specify the compression level: https://github.com/tpet/mat2/blob/21a244d6c6fcfbd9e3feb33a348678026d5824b8/libmat2/images.py#L114
This will always be the most reliable method of removing metadata, because only the picture data itself is transferred.
by default pixbuf sets a quality level of 75 for JPEGs: https://github.com/GNOME/gdk-pixbuf/blob/5a5d37bd6696c96d5567c2199cac0fbc5b86d0e8/gdk-pixbuf/io-gdip-jpeg.c#L39
which can sometimes be noticeable, particularly in dark areas e.g.: Original:
Cleaned:
You can avoid compressing the image by using the Lightweight switch -L
or --lightweight
. This has a chance to leave some metadata but is better at preserving quality, the image size will mostly remain the same:
Lightweight:
@Baa14453 thank you! So changes need to be made to mat2 in order for it to specify 100% quality or something like that?
Hello!
Why do my 20 Mb JPEGs turn into 5 Mb JPEGs after using mat2 on them? Does metadata really occupy 75% of total image size? Or maybe mat2 somehow reduces the image quality?
P.S. Can't find anything on the internet on this topic, all I get is tutorials on removing metadata :(