heic-decode
Decode HEIC images to extract raw pixel data.
Install
npm install heic-decode
Usage
const fs = require('fs');
const decode = require('heic-decode');
(async () => {
const buffer = await promisify(fs.readFile)('/path/to/my/image.heic');
const {
width,
height,
data
} = await decode({ buffer });
})();
You can use this data to integrate with other imaging libraries for processing.
Note that while the decoder returns a Promise, it does the majority of the work synchronously, so you should consider using a worker thread in order to not block the main thread in highly concurrent production environments.