Skip to content

Instantly share code, notes, and snippets.

@fileformat-heic-gists
Last active July 24, 2024 23:32
Show Gist options
  • Save fileformat-heic-gists/fd66e445fec50bd0e6d2eb636e8bc5e7 to your computer and use it in GitHub Desktop.
Save fileformat-heic-gists/fd66e445fec50bd0e6d2eb636e8bc5e7 to your computer and use it in GitHub Desktop.
Read HEIC file into int array with Argb32 data
// Open the HEIC file named "filename.heic" using FileStream.
using (var fs = new FileStream("filename.heic", FileMode.Open))
{
// Load the HEIC image from the file stream into a HeicImage object.
HeicImage image = HeicImage.Load(fs);
// Extract pixel data from the HEIC image in the ARGB32 format and store it in an integer array.
int[] pixels = image.GetInt32Array(Heic.Decoder.PixelFormat.Argb32);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment