{"id":21182806,"url":"https://github.com/seriousbug/libheif-node-dy","last_synced_at":"2026-05-19T05:41:11.907Z","repository":{"id":153256505,"uuid":"628353483","full_name":"SeriousBug/libheif-node-dy","owner":"SeriousBug","description":"Dynamically linked libheif for nodejs. Native HEIC/HEIF image decoding and information using dynamically linked libheif.","archived":false,"fork":false,"pushed_at":"2023-04-16T20:52:55.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T19:44:10.800Z","etag":null,"topics":["heic","heic-convert","heic-converter","heic-decode","heic-to-jpeg","heic-to-jpg","heic-to-png","heif","heif-converter","heif-decode","node","nodejs"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SeriousBug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-15T17:23:18.000Z","updated_at":"2025-02-12T09:13:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc249d6f-fbaf-457e-ade1-d5a053cb9185","html_url":"https://github.com/SeriousBug/libheif-node-dy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/SeriousBug/libheif-node-dy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeriousBug%2Flibheif-node-dy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeriousBug%2Flibheif-node-dy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeriousBug%2Flibheif-node-dy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeriousBug%2Flibheif-node-dy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeriousBug","download_url":"https://codeload.github.com/SeriousBug/libheif-node-dy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeriousBug%2Flibheif-node-dy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012679,"owners_count":26085159,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["heic","heic-convert","heic-converter","heic-decode","heic-to-jpeg","heic-to-jpg","heic-to-png","heif","heif-converter","heif-decode","node","nodejs"],"created_at":"2024-11-20T17:58:11.236Z","updated_at":"2025-10-12T19:44:13.091Z","avatar_url":"https://github.com/SeriousBug.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libheif-node-dy [![npm](https://img.shields.io/npm/v/libheif-node-dy)](https://www.npmjs.com/package/libheif-node-dy) [![MIT](https://img.shields.io/github/license/SeriousBug/libheif-node-dy)](https://github.com/SeriousBug/libheif-node-dy/blob/main/LICENSE)\n\nNative HEIC/HEIF image decoding and information, using dynamically linked [libheif](https://github.com/strukturag/libheif). Supports converting HEIC to JPEG, PNG, and other formats when combined with [Sharp](https://sharp.pixelplumbing.com/).\n\nThis package dynamically links against libheif. You must have libheif and its\nheaders installed yourself. It is widely available on most platforms:\n\n- Debian, Ubuntu: `libheif1 libheif-dev`\n- ArchLinux, EndeavourOS: `libheif`\n- Alpine Linux: `libheif-dev`\n- MacOS (Homebrew): `libheif`\n\nOnce you have `libheif` installed, you can install this package with `npm install libheif-node-dy`.\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst { decode, getInfo } = require('libheif-node-dy');\n// Or, import { decode, getInfo } from 'libheif-node-dy';\n\n// Or any other way to get your image into a Buffer\nconst image = fs.readFileSync('path-to.heic');\n// There is more information available! Check the type definitions.\nconst { width, height } = getInfo(image);\nconst decodedImage = decode(image);\n\n// To convert it into JPEG or PNG, use it with sharp:\nconst sharp = require('sharp');\nconst newImage = sharp(decodedImage, {\n  raw: {\n    height,\n    width,\n    channels: 4,\n  },\n});\nnewImage.jpeg().toFile(\"image.jpg\");\n// Or .toBuffer() to get a buffer to use in something else\n```\n\nYou can also look at the [benchmark/convert.js](benchmark/convert.js) file,\nwhich is an example CLI program for converting HEIC files to JPEGs.\n\n## Performance\n\n`libheif-node-dy` is around 3 to 5 times faster than `heic-decode` in decoding images.\n\n![4 violin plots. X axes are labeled Time (ms). First plot: Small images, about 0.6MP. libheif-node-dy averages around 80, heic-decode is between 264 and 284. Second plot: Medium images, about 2.5MP. libheif-node-dy averages around 280, heic-decode is slightly above 1039. Third plot: Large images, about 5.7MP. libheif-node-dy averages around 600, heic-decode is between 2322 and 2522. Fourth plot: Extra large images, 9.1MP to 24MP. libheif-node-dy averages around 1500, heic-decode is slightly below 7884.](https://github.com/SeriousBug/libheif-node-dy/raw/main/benchmark/results.png)\n\n## Licensing\n\nThis package is licensed under MIT. `libheif` is licensed under LGPL, which\ngrants an exception for dynamic linking. This package dynamically links against\nlibheif, which should satisfy that requirement. This means you can use this\npackage without licensing your software under GPL, so long as you don't bundle\nyour application in a way that restricts users from being able to replace\nlibheif.\n\nNote that other packages like\n[libheif-js](https://www.npmjs.com/package/libheif-js), and thus its\ndependencies like [heic-decode](https://www.npmjs.com/package/heic-decode) may\nrequire you to license your software under GPL if you bundle them within your\napplication in a way that users could not replace the library.\nBundlers like rollup, webpack, and others that bundle all code into one or a few\nfiles very likely will violate the LGPL exception, and will therefore require\nyou to distribute your application under GPL, if you do distribute your\napplication.\n\nThis is not legal advice, and I'm not a lawyer. Contact a lawyer if you have\nquestions on how these licenses apply to your application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseriousbug%2Flibheif-node-dy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseriousbug%2Flibheif-node-dy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseriousbug%2Flibheif-node-dy/lists"}