GitHub - mirrorer/libbpg: libbpg (copy of the source code for easy access) (original) (raw)

BPG Image library and utilities

  1. Quick introduction

  1. Compilation and Installation Notes

2.1) Linux

2.2) Windows

  1. BPG encoder

The BPG command line encoder is 'bpgenc'. It takes JPEG or PNG images as input.

  1. BPG decoder

The BPG command line decoder is bpgdec. It outputs a PNG or PPM image. Use a PPM output to get the fastest speed.

  1. BPG viewer

The BPG image viewer uses the SDL library to display BPG images and other image formats supported by the SDL_image library. The available keys are displayed by launching bpgview without parameters. bpgview supports BPG animations.

  1. BPG decoding library

BPG images can be decoded in any program with the libbpg library.

The API is not considered stable yet so that the library is only provided as a static one.

Currently there is no similar library for encoding so you should invoke the bpgenc utility.

  1. Javascript decoder

The following Javascript decoders are available, sorted by increasing size:

         > 8 bits   animations

bpgdec8.js no no bpgdec.js yes no bpgdec8a.js no yes

The 8 bit only decoders are a little faster and consumes less memory (16 MB instead of 32 MB by default, you can change the memory configuration in the Makefile if you want to handle larger images).

The Javascript decoder substitutes all the tags with a source having a .bpg extension with a tag and decodes the BPG image into it. Stylesheets are supported (the 'id' and 'class' attributes are preserved). The 'width' and 'height' attributes are supported only with pixel units.

The image data is downloaded with the XMLHttpRequest object. So the BPG images and the BPG Javascript decoder must be in the same domain unless Cross-Origin Resource Sharing is used.

When animations are displayed, all the frames are stored in memory, so animations with a large number of frames and large resolutions should be avoided, as with animated GIFs.

asm.js gives an interesting speed boost, so we hope that more browsers will support this Javascript subset.

  1. FFmpeg modifications

  1. x265 modifications

  1. Licensing