-
-
Notifications
You must be signed in to change notification settings - Fork 884
Closed
Labels
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUG
andRELEASE
mode - I have searched open and closed issues to ensure it has not already been reported
ImageSharp version
3.1.11
Other ImageSharp packages and versions
none
Environment (Operating system, version and so on)
Linux Ubuntu 24.04
.NET Framework version
net9.0
Description
Hello,
We found an image that is losing transparency after resizing it. After digging more into it the only "special" things seems to be there is a png:tRNS chunk on it.
Steps to Reproduce
I cannot share this image, so I tried to recreate the image with the same properties, the problem seems to be the there with the test image, but I'm not an expert about this. (to be transparent, I used Claude to generate this image: https://claude.ai/public/artifacts/8c3ecd97-14dc-4f37-852e-3cdaea076671)
Source image: (2x2
pixels, displayed at 64x64
)

Result after resize to 4x4
ImageSharp
When using ImageSharp with the following piece of code, the result does not have any transparency
using var a = Image.Load("test_trns.png");
using var b = a.Clone(x => x.Resize(4, 4));
b.Save("test.imagesharp.png");

ImageMagick
When using image magick convert test_trns_fixed.png -resize 4x4 test.imagemagick.png
it's works as expected

Images
No response
IAMManuel and christianrondeau