This repository was archived by the owner on Apr 26, 2024. It is now read-only.
media/thumbnailer: Better quality for 1-bit / 8-bit color palette images#2142
Merged
media/thumbnailer: Better quality for 1-bit / 8-bit color palette images#2142
Conversation
Pillow will use nearest neighbour as the resampling algorithm if the source image is either 1-bit or a color palette using 8 bits. If we convert to RGB before scaling, we'll probably get a better result.
Member
|
lgtm, but please do test it first. setting up a synapse on OSX is absolutely trivial and very worthwhile - in your git checkout, just: i'd be surprised if copy-pasting that didn't give you a working homeserver on port 8008 ready to test against. |
NegativeMjark
approved these changes
Apr 21, 2017
Contributor
NegativeMjark
left a comment
There was a problem hiding this comment.
LGTM, but it might be nice to test uploading a 1-bit image with a unit test or a sytest. (I'm happy to take you at your word wrt image quality, but it would be nice to have some way to check it doesn't crash)
Contributor
Member
|
I don't know why we never merged this |
richvdh
approved these changes
Oct 3, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pillow will use nearest neighbour as the resampling algorithm if the
source image is either 1-bit or a color palette using 8 bits. If we
convert to RGB before scaling, we'll probably get a better result.
Note: I haven't actually tested this but setting up a synapse just to do so is more effort than I'm willing at this particular moment.