Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • funkwhale funkwhale
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 409
    • Issues 409
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • funkwhalefunkwhale
  • funkwhalefunkwhale
  • Merge requests
  • !1112

Increase image quality of downscaled images from 70 to 95

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Tony Wasserka requested to merge neobrain/funkwhale:develop into develop May 05, 2020
  • Overview 5
  • Commits 2
  • Pipelines 5
  • Changes 7

django-versatileimagefield will save resized images (such as downscaled cover art) with the default quality settings, 70, hence producing horrible artifacts for many kinds of images.

Since it's hard to pick a good default that works for all cover images, I went for the highest quality recommended in the Pillow documentation. In a testing cover of mine (with high contrast and many flat shaded color areas), 90 produced visible artifacts still, whereas only 97 and upwards were indistinguishable from the losslessly scaled image. 95 is a reasonable compromise, for which artifacts are only visible if you squint your eyes.

In this testing image, the file size increased from 8 KiB to 21 KiB. Since cover art thumbnails make up only a small part of the storage space required for Funkwhale, this seems reasonable.

WARNING: Currently, merging this change will cause all existing cover art to 404. Funkwhale encodes the quality setting in the image URL (which is updated automatically) but won't automatically regenerate any cover art thumbnails. We could flip the create_images_on_demand setting to True, but I'm not sure what effects this may have on performance.

Edited May 07, 2020 by Agate
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: develop