Uploaded Emoji are a bit desaturated?

AI-generated summary

The thread discusses an issue where uploaded emojis appear desaturated. iamntz reported that re-uploading an existing emoji resulted in color loss, noting that the default Apple emojis are 64x64. zogstrip identified that the system was downsizing images to 60x60 using the ImageMagick thumbnail operation, which prioritizes file size over quality. elberet confirmed that thumbnail is a poor choice for emojis, while codinghorror suspected ImageMagick was altering black and white images.

zogstrip resolved the issue by modifying the code to resize to 100x100 using the standard resize option instead of thumbnail. iamntz had previously questioned why the system didn’t simply match the base size of current emojis. Following the fix, codinghorror and zogstrip verified the solution by uploading test images, confirming that the colors now appear correct.

Hi guys. I tried to upload a new emoji but both size and colors seemed to be a bit off. So i tried the following:

  • downloaded an existing emoji (that is bundled into Discourse)
  • tried to re-upload

After that, i opened both images in new tabs (so there is no css involved) and I have this result:

(left image is the uploaded one)

「いいね!」 3

We downsize uploaded emoji to make sure they fit in a 60x60 square.

Maybe one of the Image Magick option is altering the emoji?

「いいね!」 1

But… Why? Since the default (apple) emoji are 64x64 and emoji one (i think) are 74x74, it wouldn’t make more sense to have them resized to the current emoji scheme base size? :confused:

「いいね!」 2

This might be related to Image Magick messing up black and white images too.

Maybe Image could do with a little less Magicks

「いいね!」 1

What, like ImageScience? :smirk:

In all seriousness, tho, I’m guessing that the -thumbnail operation is a bad choice. It focuses filesize over everything else, and while this may be fine for actual thumbnails, it’s not desireable for emojis (which are small enough anyways).

「いいね!」 3

Thanks @iamntz for reporting that issue. I updated the code so that we only downsize to 100x100 using the resize option instead of thumbnail. :beetle:

https://github.com/discourse/discourse/commit/a87083fa7641267339e06a77773601594570d0fd

「いいね!」 6

@zogstrip can you verify we don’t have any lingering issues here? Maybe upload emoji to test?

Here’s one:

「いいね!」 1

Here’s another 2.

They look fine to me.

「いいね!」 2