BPG (Better Portable Graphics) is a new image format. Its purpose is
to replace the JPEG image format when quality or file size is an
issue. Its main advantages are:

  • High compression ratio. Files are much smaller than JPEG for
    similar quality.
  • Supported by most Web browsers with a small Javascript decoder
    (gzipped size: 56 KB).
  • Based on a subset of
    the HEVC
    open video compression standard.
  • Supports the same chroma formats as JPEG (grayscale, YCbCr 4:2:0,
    4:2:2, 4:4:4) to reduce the losses during the conversion. An alpha
    channel is supported. The RGB, YCgCo and CMYK color spaces are also
  • Native support of 8 to 14 bits per channel for a higher dynamic range.
  • Lossless compression is supported.
  • Various metadata (such
    as EXIF, ICC profile, XMP)
    can be included.
  • Animation support.


The following archive contains the source code of the bpgenc,
bpgdec and bpgview command line utilities (for
Linux) and the associated libbpg library (read the README
file in the archive). It also includes the source code of the
Javascript decoder.


Binary distribution for Windows (64 bit only):

Unofficial Github mirror.

For Mac users, the BPG utilities are available in the libbpg Homebrew formula.


  • Mozilla did
    a study
    of various lossy compressed image formats
    . HEVC (hence BPG) was a
    clear winner by a wide margin. BPG files are actually a little
    smaller than raw HEVC files because the BPG header is smaller than
    the corresponding HEVC header.

  • BPG natively supports 8 to 14 bits per channel when most other
    formats use 8 bits (including most of the JPEG implementations
    and WEBP). It gives a
    higher dynamic range (which is important for cameras and new displays)
    and a slightly better compression ratio (because there are less
    rounding errors in the decoder).

  • BPG uses high quality decimation (10 tap Lanczos filter) and
    interpolation (7 tap Lanczos filter) to handle the chroma samples in
    4:2:2 and 4:2:0 formats.

  • BPG can be supported in hardware with standard HEVC decoders and
    encoders (it uses a subset of the Main 4:4:4 16 Still Picture Profile,
    Level 8.5).


Technical information

The specification of the BPG file format is
available here.


  • The BPG decoding library uses a modified version of FFmpeg
    released under the LGPL version 2.1 as HEVC decoder. The BPG decoding
    library excluding the FFmpeg code is released under the BSD license.
  • The BPG encoder as a whole is released under the GPL version 2
    license. The BPG encoder sources excluding x265 are released under the
    license. The x265
    library is released under the GPL version 2 license. The optional
    JCTVC HEVC reference
    is released under the BSD license.
  • Some of the HEVC algorithms may be protected by patents in some
    countries (read the FFmpeg
    Patent Mini-FAQ
    for more information). Most devices already include
    or will include hardware HEVC support, so we suggest to use it if
    patents are an issue.

Fabrice Bellard –

Read More

ترك الرد

من فضلك ادخل تعليقك
من فضلك ادخل اسمك هنا