Last active
July 24, 2024 23:32
-
-
Save fileformat-heic-gists/fd66e445fec50bd0e6d2eb636e8bc5e7 to your computer and use it in GitHub Desktop.
Read HEIC file into int array with Argb32 data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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