Skip to content
/ heic2any Public
forked from alexcorvi/heic2any

Converting HEIF/HEIF image formats to PNG in the browser

License

Notifications You must be signed in to change notification settings

nota/heic2any

 
 

Repository files navigation

HEIC2ANY

converting HEIC/HEIF image files to JPEG/PNG/GIF in the browser. This tool is specifically for the browser environment, it WILL NOT work in node environment.

Click here for demo


  • Installation: yarn
yarn add heic2any
  • Installation: npm
npm install heic2any
  • Installation: no module bundler
<!-- just include the file in a script tag -->
<script src="./dist/index.js">
  • Usage: Typescript & Javascript
import heic2any from "heic2any";
// or
const heic2any = require("heic2any");
// skip the lines above if you're not using a module bundler
// and would prefer to include a <script> tag in your HTML file

// this is our heif image file
const HEICBlobFile = new Blob();

heic2any({
	// required: the HEIF blob file
	blob: HEICBlobFile,
	// (optional) MIME type of the target file
	// it can be "image/jpeg", "image/png" or "image/gif"
	// defaults to "image/png"
	toType: "image/jpeg",
	// conversion quality
	// a number ranging from 0 to 1
	quality: 0.8
});

This project is heavily based on the excellent libheif by struktur.

About

Converting HEIF/HEIF image formats to PNG in the browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 49.5%
  • TypeScript 27.1%
  • JavaScript 23.4%