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 ?..
Users reported an issue where PNG images with transparency were being converted to JPGs upon upload to their Discourse forum, causing loss of transparency and displaying white backgrounds. eextra first raised the issue after trying multiple images, including large ones, with no success. tshenry suggested this might be due to automatic conversion to JPG for file size reduction, and linked to documentation explaining the behavior and how to adjust settings. Quddus confirmed trying the fix (setting png_to_jpg_quality to 100) but still experienced conversion. manuel offered GIMP export tips — disabling “Save background color” and enabling “Save gamma” — though later noted he could no longer reproduce the issue. jamie.wilson identified and merged a fix for a bug where PNGs were incorrectly converted to JPGs even when conversion was disabled, and requested users to update their Discourse instance. Quddus later confirmed the fix resolved the problem. The root cause was a software bug in Discourse’s image handling logic, not user error or GIMP settings.
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
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)
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.
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 ![]()
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?
Yes, it works great now! Sorry for the delayed response.
Thanks ![]()