Skip to content
Discussion options

You must be logged in to vote

The issue with ImageMagick/Magick.NET is that you are feeding it data and it has no idea what you are feeding it. You could do something like this to read raw pixel data:

var data = GetByteArray();
var settings = new PixelReadSettings
{
    Mapping = "R", // Only a single red (grey) channel
    StorageType = StorageType.Short, // 16-bit per pixel
    ReadSettings = new MagickReadSettings
    {
        // You probably need to change this to the correct value
        Width = 100, 
        Height = 100
    }
};

using (var image = new MagickImage())
{
    image.ReadPixels(data, settings);
    image.Write("yourfile.png");
}

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dlemstra
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by wario2k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants