Problem with category image transparency

I can’t understand it, I’m creating icon in Gimp. Adds transparency.

Windows and other programs have a good interpretation, but on the forum a white background is added to the image.

6 hours I get tired of it. What am I doing wrong ?..

Do you know if the image is a PNG or a JPG file after it has been uploaded? My guess is that it’s being converted to a JPG which will remove the transparency. If that’s the case, here’s what you can try:

You can also read more about the conversion behavior here: Very small PNGs are inappropriately converted to JPGs - #23 by sam

5 Likes

Okay, I’ll check it out, but tell me why it’s happening. What is the intention of such conversion?

btw
I tried with many pictures, even loaded very large ones on the whole screen and the problem still existed.

The idea is to cut down the file size whenever possible to reduce the impact on any storage limits.

Have you tried uploading an image with transparency after changing the setting I mentioned? If you are using the same image, it’s possible you may need to alter a pixel so the system does not see it as a duplicate and keep the converted version in favor of the PNG version (this was mentioned in the link I shared)

3 Likes

Hi, I’ve set the png to jpg setting to 100 and edited the new version and I’m still getting converted to jpg. Any suggestions?

I’m not sure, I think @jamie.wilson worked on this recently? The settings should allow control over the conversion.

2 Likes

In my experience with Gimp you have to set the export settings as such:

Screenshot from 2020-12-07 14-25-04

  • Disable “Save background color”
  • Enable “Save gamma”

Yes, the transparency is intact when I upload the png. The issue is that the file is still be turned into a jpg, which do not support transparency.

Yes, in other programs. But if the file has a background property, it will be converted to jpg. If you disable the background, then not. That’s just my experience.

Edit: actually, no. I had this problem with transparencies, but can’t reproduce it now. Just always works :man_shrugging:

https://github.com/discourse/discourse/commit/70050a8ba365628394fbf7597daf75891328d991

I identified a situation where pngs would be converted to jpegs even when png_to_jpg_quality was set to 100, and merged in a fix just now. Hopefully this addresses the problem you had encountered.

Can you update your Discourse instance and let us know if the problem has been resolved?

2 Likes

Yes, it works great now! Sorry for the delayed response.

Thanks :laughing:

2 Likes