question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GetPixelsUnsafe operations reset ColorType

See original GitHub issue

Description

Using GetPixelsUnsafe for either read or write results in the MagickImage object itself resetting the ColorType to TrueColor regardless of what it was set to before.

Steps to Reproduce

m.ColorType = ColorType.Grayscale;
using (var pix = m.GetPixelsUnsafe())
{
       return pix.ToArray();
}
Console.WriteLine(m.ColorType);

System Configuration

  • Magick.NET version: 8.3 (also reproducible in previous 8.x builds)
  • Environment (Operating system, version and so on): Windows 10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dlemstracommented, Sep 7, 2021

This is caused by the call to mm.Alpha(AlphaOption.Off). Not sure why this is happening though.

0reactions
daxpandhicommented, Oct 19, 2021

Yes, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Magick.NET
Using GetPixelsUnsafe for either read or write results in the MagickImage object itself resetting the ColorType to TrueColor regardless of what it was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found