GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ikerr/libheif: libheif is a ISO/IEC 23008-12:2017 HEIF file format decoder and encoder.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

575 Commits
575 Commits

Folders and files

NameName
Last commit message
Last commit date
cxx
cxx
 
 
examples
examples
 
 
extra
extra
 
 
gnome
gnome
 
 
go/src
go/src
 
 
m4
m4
 
 
scripts
scripts
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CMakeLists.txt
CMakeLists.txt
 
 
COPYING
COPYING
 
 
CPPLINT.cfg
CPPLINT.cfg
 
 
Makefile.am
Makefile.am
 
 
README.md
README.md
 
 
appveyor.yml
appveyor.yml
 
 
autogen.sh
autogen.sh
 
 
build-emscripten.sh
build-emscripten.sh
 
 
configure.ac
configure.ac
 
 
libheif.pc.in
libheif.pc.in
 
 
post.js
post.js
 
 
pre.js
pre.js
 
 

Repository files navigation

libheif

Build Status Build Status

libheif is an ISO/IEC 23008-12:2017 HEIF file format decoder and encoder.

HEIF is a new image file format employing HEVC (h.265) image coding for the best compression ratios currently possible.

libheif makes use of libde265 for the actual image decoding and x265 for encoding. Alternative codecs for, e.g., AVC and JPEG can be provided as plugins.

Supported features

libheif has support for decoding

  • tiled images
  • alpha channels
  • thumbnails
  • reading EXIF data
  • reading the depth channel
  • multiple images in a HEIF file
  • image transformations (crop, mirror, rotate)
  • overlay images
  • plugin interface to add decoders for additional formats (AVC, JPEG)

The encoder supports:

  • lossy compression with adjustable quality
  • lossless compression
  • alpha channels

API

The library has a C API for easy integration and wide language support. Note that the API is still work in progress and may still change.

Loading the primary image in a HEIF file is as easy as this:

heif_context* ctx = heif_context_alloc();
heif_context_read_from_file(ctx, input_filename, nullptr);

// get a handle to the primary image
heif_image_handle* handle;
heif_context_get_primary_image_handle(ctx, &handle);

// decode the image and convert colorspace to RGB, saved as 24bit interleaved
heif_image* img;
heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_24bit, nullptr);

int stride;
const uint8_t* data = heif_pixel_image_get_plane_readonly(img, heif_channel_interleaved, &stride);

Writing an HEIF file can be done like this:

heif_context* ctx = heif_context_alloc();
heif_context_new_heic(ctx);

// get the default encoder
heif_encoder* encoder;
heif_context_get_encoder_for_format(ctx, heif_compression_HEVC, &encoder);

// set the encoder parameters
heif_encoder_set_lossy_quality(encoder, 50);

// encode the image
heif_image* image; // code to fill in the image omitted in this example
heif_context_encode_image(ctx, nullptr, image, encoder);

heif_encoder_release(encoder);

heif_context_write_to_file(context, "output.heic");

See the header file heif.h for the complete C API.

Compiling

This library uses a standard autoconf/automake build system. After downloading, run ./autogen.sh to build the configuration scripts, then call ./configure and make. Make sure that you compile and install libde265 first, so that the configuration script will find this. Preferably, download the frame-parallel branch of libde265, as this uses a more recent API than version in the master branch. Also install x265 and its development files if you want to use HEIF encoding.

Compiling to JavaScript

libheif can also be compiled to JavaScript using emscripten. See the build-emscripten.sh for further information.

Online demo

Check out this online demo. This is libheif running in JavaScript in your browser.

Example programs

Some example programs are provided in the examples directory. The program heif-convert converts all images stored in an HEIF file to JPEG or PNG. heif-enc lets you convert JPEG files to HEIF. The program heif-info is a simple, minimal decoder that dumps the file structure to the console.

There is also a GIMP plugin using libheif here.

HEIF thumbnails for the Gnome desktop

The program heif-thumbnailer can be used as a HEIF thumbnailer for the Gnome desktop. The matching Gnome configuration files are in the gnome directory. Place the file heif.xml into /usr/share/mime/packages and heif.thumbnailer into /usr/share/thumbnailers. You may have to run update-mime-database /usr/share/mime to update the list of known MIME types.

License

The libheif is distributed under the terms of the GNU Lesser General Public License. The sample applications are distributed under the terms of the GNU General Public License.

See COPYING for more details.

Copyright (c) 2017-2018 Struktur AG Contact: Dirk Farin [email protected]

About

libheif is a ISO/IEC 23008-12:2017 HEIF file format decoder and encoder.

www.libheif.org

Resources

Readme
License
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.