All Projects â†’ catdad-experiments â†’ heic-convert

catdad-experiments / heic-convert

Licence: other
🤳 convert heic/heif images to jpeg and png

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to heic-convert

HEIF-converter
Converter for High Efficiency Image Format(HEIF)
Stars: ✭ 24 (-76.92%)
Mutual labels:  jpg, png, convert, heif, heic, heic-to-jpg, heic-to-png
HEIF
Mac OS X: Convert any image to HEIF/HEIC format
Stars: ✭ 58 (-44.23%)
Mutual labels:  jpg, png, convert, heif, heic
imei
IMEI - ImageMagick Easy Install
Stars: ✭ 126 (+21.15%)
Mutual labels:  jpg, png, heic
autosvg
Autosvg is tracing tool, which can convert image format like (jpg,png,gif) into vector
Stars: ✭ 35 (-66.35%)
Mutual labels:  jpg, png, convert
Ccapture.js
A library to capture canvas-based animations at a fixed framerate
Stars: ✭ 2,836 (+2626.92%)
Mutual labels:  jpg, png
Gimage
A PHP library for easy image handling. 🖼
Stars: ✭ 148 (+42.31%)
Mutual labels:  jpg, png
wordpress-plugin
Speed up your WordPress website. Optimize your JPEG and PNG images automatically with TinyPNG.
Stars: ✭ 78 (-25%)
Mutual labels:  jpg, png
oculante
A minimalistic crossplatform image viewer written in rust
Stars: ✭ 169 (+62.5%)
Mutual labels:  jpg, png
Quickshot
Capture images of any View, SurfaceView or Bitmap from your Android app in: .jpg .png or .nomedia with simple oneliner codes.
Stars: ✭ 663 (+537.5%)
Mutual labels:  jpg, png
node-pdftocairo
📃 Node.js wrapper for pdftocairo - PDF to PNG/JPEG/TIFF/PDF/PS/EPS/SVG using cairo
Stars: ✭ 17 (-83.65%)
Mutual labels:  png, convert
3dn-bip
A Python library for Blender addons. Blazingly fast preview loads in Blender. Images of arbitrary size. bpy.utils.previews drop-in replacement.
Stars: ✭ 41 (-60.58%)
Mutual labels:  jpg, png
Imageviewer
HDR, PFM, DDS, KTX, EXR, PNG, JPG, BMP image viewer and manipulator
Stars: ✭ 71 (-31.73%)
Mutual labels:  jpg, png
Optimise Images
Batch image resizer, optimiser and profiler using ImageMagick convert, OptiPNG, JpegOptim and optional ZopfliPNG, Guetzli and MozJPEG.
Stars: ✭ 64 (-38.46%)
Mutual labels:  jpg, png
Image Optimizer
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.
Stars: ✭ 785 (+654.81%)
Mutual labels:  jpg, png
libheif-sharp
Provides .NET bindings for libheif.
Stars: ✭ 30 (-71.15%)
Mutual labels:  heif, heic
save-html-as-image
Download the HTML (DOM) to Image (JPG, PNG)
Stars: ✭ 26 (-75%)
Mutual labels:  jpg, png
saveddit
Bulk Downloader for Reddit
Stars: ✭ 130 (+25%)
Mutual labels:  jpg, png
ee.Screen
Takes screenshots of web pages for the list of URLs. Various resolutions, multiple formats (JPG, PDF, PNG and TXT)
Stars: ✭ 19 (-81.73%)
Mutual labels:  jpg, png
Exifr
📷 The fastest and most versatile JS EXIF reading library.
Stars: ✭ 448 (+330.77%)
Mutual labels:  jpg, png
Imagemin
[Unmaintained] Minify images seamlessly
Stars: ✭ 4,948 (+4657.69%)
Mutual labels:  jpg, png

heic-convert

Convert HEIC/HEIF images to JPEG and PNG

travis npm-downloads npm-version

Install

npm install heic-convert

Usage

Convert the main image in a HEIC to JPEG

const { promisify } = require('util');
const fs = require('fs');
const convert = require('heic-convert');

(async () => {
  const inputBuffer = await promisify(fs.readFile)('/path/to/my/image.heic');
  const outputBuffer = await convert({
    buffer: inputBuffer, // the HEIC file buffer
    format: 'JPEG',      // output format
    quality: 1           // the jpeg compression quality, between 0 and 1
  });

  await promisify(fs.writeFile)('./result.jpg', outputBuffer);
})();

Convert the main image in a HEIC to PNG

const { promisify } = require('util');
const fs = require('fs');
const convert = require('heic-convert');

(async () => {
  const inputBuffer = await promisify(fs.readFile)('/path/to/my/image.heic');
  const outputBuffer = await convert({
    buffer: inputBuffer, // the HEIC file buffer
    format: 'PNG'        // output format
  });

  await promisify(fs.writeFile)('./result.png', outputBuffer);
})();

Convert all images in a HEIC

const { promisify } = require('util');
const fs = require('fs');
const convert = require('heic-convert');

(async () => {
  const inputBuffer = await promisify(fs.readFile)('/path/to/my/image.heic');
  const images = await convert.all({
    buffer: inputBuffer, // the HEIC file buffer
    format: 'JPEG'       // output format
  });

  for (let idx in images) {
    const image = images[idx];
    const outputBuffer = await image.convert();
    await promisify(fs.writeFile)(`./result-${idx}.jpg`, outputBuffer);
  }
})();

The work to convert an image is done when calling image.convert(), so if you only need one of the images in a multi-image file, you can convert just that one from the images array and skip doing any work for the remaining images.

Note that while the converter returns a Promise and is overall asynchronous, a lot of work is still done synchronously, so you should consider using a worker thread in order to not block the main thread in highly concurrent production environments.

Related

  • heic-cli - convert heic/heif images to jpeg or png from the command line
  • heic-decode - decode heic images to raw image data
  • libheif-js - libheif as a pure-javascript npm module
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].