Is your feature request related to a problem? Please describe.
The ImageMagick PDF thumbnail filter in DSpace versions up to 7.6 has several problems:
- Generation loss due to converting PDF → lossy JPEG → lossy JPEG. See
ImageMagickPdfThumbnailFilter.java
- Uses outdated JPEG format.
Describe the solution you'd like
First, doing a double lossy conversion is a waste of resources and an obvious bad practice when working with lossy codecs. I recently estimated an average drop of 1.2 points in the ssimulacra2 score due to generation loss. This is like making a photocopy of a photocopy.
Second, we should be using a more modern image format that allows similar visual quality with drastically reduced file sizes. I propose WebP, which requires an average of 33% fewer bits than JPEG to achieve the same visual quality and has broad support in web browsers and beyond. (Yes I know that WebP is not perfect and is already over ten years old, but the results speak for themselves).
On this second point, I have done an extensive evaluation of JPEG versus WebP and AVIF using a large sample of PDFs. The results can be summarized in this one plot of perceptual quality versus bits per pixel (BPP):
AVIF and WebP need less bits than JPEG to achieve the same visual quality
My full comparison, with methodology and source code, is here: Evaluating JPEG, WebP, and AVIF
Additional context
There has been some past discussion and work on the ImageMagick PDF thumbnail filter:
Is your feature request related to a problem? Please describe.
The ImageMagick PDF thumbnail filter in DSpace versions up to 7.6 has several problems:
ImageMagickPdfThumbnailFilter.javaDescribe the solution you'd like
First, doing a double lossy conversion is a waste of resources and an obvious bad practice when working with lossy codecs. I recently estimated an average drop of 1.2 points in the ssimulacra2 score due to generation loss. This is like making a photocopy of a photocopy.
Second, we should be using a more modern image format that allows similar visual quality with drastically reduced file sizes. I propose WebP, which requires an average of 33% fewer bits than JPEG to achieve the same visual quality and has broad support in web browsers and beyond. (Yes I know that WebP is not perfect and is already over ten years old, but the results speak for themselves).
On this second point, I have done an extensive evaluation of JPEG versus WebP and AVIF using a large sample of PDFs. The results can be summarized in this one plot of perceptual quality versus bits per pixel (BPP):
AVIF and WebP need less bits than JPEG to achieve the same visual quality
My full comparison, with methodology and source code, is here: Evaluating JPEG, WebP, and AVIF
Additional context
There has been some past discussion and work on the ImageMagick PDF thumbnail filter: