Skip to content

Silent data corruption of output images resulting in incorrect colors #1985

Description

@park-jemin

Magick.NET version

Magick.NET-Q8-AnyCPU v14.10.4

Environment (Operating system, version and so on)

Linux

Description

Starting with Magick.NET 14.10.4 (which bundles ImageMagick 7.1.2-16), images with alpha channels appear visibly dimmer after being processed with a CopyAlpha composite operation.

Steps to Reproduce

// Upload any PNG with transparency as an image
var magickImage = new MagickImage(inputStream);  // PNG with alpha

// Resize with alpha preservation
using var sourceImageAlpha = new MagickImage(magickImage);
sourceImageAlpha.Resize(150, 150);
magickImage.Alpha(AlphaOption.Off);
magickImage.Resize(150, 150);
magickImage.Composite(sourceImageAlpha, CompositeOperator.CopyAlpha);

// Convert and write
magickImage.Format = MagickFormat.Png;
await magickImage.WriteAsync(outputStream);

// Result: output image appears dimmer than input, dark areas become transparent

Images

Original:

Image

Output:

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions