{"id":26949616,"url":"https://github.com/catdad-experiments/heic-decode","last_synced_at":"2025-06-25T15:08:17.551Z","repository":{"id":56772595,"uuid":"234648804","full_name":"catdad-experiments/heic-decode","owner":"catdad-experiments","description":"🤳 decode heic images to extracts the raw pixel data","archived":false,"fork":false,"pushed_at":"2023-12-01T06:17:19.000Z","size":35,"stargazers_count":47,"open_issues_count":3,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-30T11:50:54.652Z","etag":null,"topics":["decode","heic","heif","image","npm-module"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catdad-experiments.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-17T22:37:20.000Z","updated_at":"2025-05-12T10:10:30.000Z","dependencies_parsed_at":"2024-06-18T16:57:18.780Z","dependency_job_id":null,"html_url":"https://github.com/catdad-experiments/heic-decode","commit_stats":{"total_commits":49,"total_committers":2,"mean_commits":24.5,"dds":0.04081632653061229,"last_synced_commit":"eac48dd423bd9a1b326a0fe6a53750576b0eec77"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/catdad-experiments/heic-decode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fheic-decode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fheic-decode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fheic-decode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fheic-decode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catdad-experiments","download_url":"https://codeload.github.com/catdad-experiments/heic-decode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fheic-decode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261897031,"owners_count":23226649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decode","heic","heif","image","npm-module"],"created_at":"2025-04-02T22:16:46.692Z","updated_at":"2025-06-25T15:08:17.530Z","avatar_url":"https://github.com/catdad-experiments.png","language":"JavaScript","readme":"# heic-decode\n\n\u003e Decode HEIC images to extract raw pixel data.\n\n[![CI][ci.svg]][ci.link]\n[![npm-downloads][npm-downloads.svg]][npm.link]\n[![npm-version][npm-version.svg]][npm.link]\n\n[ci.svg]: https://github.com/catdad-experiments/heic-decode/actions/workflows/ci.yml/badge.svg\n[ci.link]: https://github.com/catdad-experiments/heic-decode/actions/workflows/ci.yml\n[npm-downloads.svg]: https://img.shields.io/npm/dm/heic-decode.svg\n[npm.link]: https://www.npmjs.com/package/heic-decode\n[npm-version.svg]: https://img.shields.io/npm/v/heic-decode.svg\n\n## Install\n\n```bash\nnpm install heic-decode\n```\n\n## Usage\n\nDecode the main image in the file:\n\n```javascript\nconst fs = require('fs');\nconst { promisify } = require('util');\nconst decode = require('heic-decode');\n\n(async () =\u003e {\n  const buffer = await promisify(fs.readFile)('/path/to/my/image.heic');\n  const {\n    width,  // integer width of the image\n    height, // integer height of the image\n    data    // Uint8ClampedArray containing pixel data\n  } = await decode({ buffer });\n})();\n```\n\nDecode all images in the file:\n\n```javascript\nconst fs = require('fs');\nconst { promisify } = require('util');\nconst decode = require('heic-decode');\n\n(async () =\u003e {\n  const buffer = await promisify(fs.readFile)('/path/to/my/multi-image.heic');\n  const images = await decode.all({ buffer });\n\n  for (let image of images) {\n    // decode and use each image individually\n    // so you don't run out of memory\n    const {\n      width,  // integer width of the image\n      height, // integer height of the image\n      data    // Uint8ClampedArray containing pixel data\n    } = await image.decode();\n  }\n})();\n```\n\nWhen the images are decoded, the return value is a plain object in the format of [`ImageData`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData). You can use this object to integrate with other imaging libraries for processing.\n\n_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._\n\n## Related\n\n* [heic-cli](https://github.com/catdad-experiments/heic-cli) - convert heic/heif images to jpeg or png from the command line\n* [heic-convert](https://github.com/catdad-experiments/heic-convert) - convert heic/heif images to jpeg and png\n* [libheif-js](https://github.com/catdad-experiments/libheif-js) - libheif as a pure-javascript npm module\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatdad-experiments%2Fheic-decode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatdad-experiments%2Fheic-decode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatdad-experiments%2Fheic-decode/lists"}