Skip to content

Re-work the ImageMagick PDF thumbnail filter #8849

Description

@alanorth

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:

  1. Generation loss due to converting PDF → lossy JPEG → lossy JPEG. See ImageMagickPdfThumbnailFilter.java
  2. 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedNeeds a volunteer to claim to move forwardnew featurestaleThis issue or PR is stale because it has not been updated in a long time.tools: media-filtersRelated to filter-media, full text extraction or thumbnail creation

    Type

    No type

    Projects

    Status
    ✅ Done / Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions