# Uploading Grayscale images causes the image to be darkened

**URL:** <https://meta.discourse.org/t/uploading-grayscale-images-causes-the-image-to-be-darkened/24616>\
**Category:** Bug\
**Created:** [2015 年 1 月 30 日午後 3:10 UTC](https://meta.discourse.org/t/uploading-grayscale-images-causes-the-image-to-be-darkened/24616 "2015-01-30T15:10:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2015 年 1 月 30 日午後 3:44 UTC](https://meta.discourse.org/t/uploading-grayscale-images-causes-the-image-to-be-darkened/24616/4 "2015-01-30T15:44:54Z")

</div>

We’re using both ImageMagick and ImageOptim to make sure thumbnails are as small as possible

> <https://github.com/discourse/discourse/blob/main/app/models/optimized_image.rb#L81-L115>

Not sure what’s causing the image to be darkened though ☹

- GIF: `convert in.gif -coalesce -gravity center -thumbnail 100x100^ -extent 100x100 -layers optimize out.gif`
- OTHER: `convert in.png[0] -background transparent -gravity center -thumbnail 100x100^ -extent 100x100 -interpolate bicubic -unsharp 2x0.5+0.7+0 -quality 98 out.png`

---

_[View the full topic](https://meta.discourse.org/t/uploading-grayscale-images-causes-the-image-to-be-darkened/24616)._
