Progressive Graphics File

File format

(Learn how and when to remove this template message)
.pgf
Internet media typeimage/x-pgfMagic number504746h (ASCII PGF)Developed byxeraina GmbHInitial release2000; 24 years ago (2000)Latest release
7.21.7
2021; 3 years ago (2021)
Type of formatwavelet-based bitmapped image formatExtended fromJPEG, PNGOpen format?LGPLv2[1]

PGF (Progressive Graphics File) is a wavelet-based bitmapped image format that employs lossless and lossy data compression. PGF was created to improve upon and replace the JPEG format. It was developed at the same time as JPEG 2000 but with a focus on speed over compression ratio.[citation needed]

PGF can operate at higher compression ratios without taking more encoding/decoding time and without generating the characteristic "blocky and blurry" artifacts of the original DCT-based JPEG standard.[2] It also allows more sophisticated progressive downloads.[citation needed]

Color models

PGF supports a wide variety of color models:

Technical discussion

PGF claims to achieve an improved compression quality over JPEG adding or improving features such as scalability. Its compression performance is similar to the original JPEG standard. Very low and very high compression rates (including lossless compression) are also supported in PGF. The ability of the design to handle a very large range of effective bit rates is one of the strengths of PGF. For example, to reduce the number of bits for a picture below a certain amount, the advisable thing to do with the first JPEG standard is to reduce the resolution of the input image before encoding it — something that is ordinarily not necessary for that purpose when using PGF because of its wavelet scalability properties.

The PGF process chain contains the following four steps:

  1. Color space transform (in case of color images)
  2. Discrete Wavelet Transform
  3. Quantization (in case of lossy data compression)
  4. Hierarchical bit-plane run-length encoding

Color components transformation

Initially, images have to be transformed from the RGB color space to another color space, leading to three components that are handled separately. PGF uses a fully reversible modified YUV color transform. The transformation matrices are:

[ Y r U r V r ] = [ 1 4 1 2 1 4 1 1 0 0 1 1 ] [ R G B ] ; [ R G B ] = [ 1 3 4 1 4 1 1 4 1 4 1 1 4 3 4 ] [ Y r U r V r ] {\displaystyle {\begin{bmatrix}Y_{r}\\U_{r}\\V_{r}\end{bmatrix}}={\begin{bmatrix}{\frac {1}{4}}&{\frac {1}{2}}&{\frac {1}{4}}\\1&-1&0\\0&-1&1\end{bmatrix}}{\begin{bmatrix}R\\G\\B\end{bmatrix}};\qquad \qquad {\begin{bmatrix}R\\G\\B\end{bmatrix}}={\begin{bmatrix}1&{\frac {3}{4}}&-{\frac {1}{4}}\\1&-{\frac {1}{4}}&-{\frac {1}{4}}\\1&-{\frac {1}{4}}&{\frac {3}{4}}\end{bmatrix}}{\begin{bmatrix}Y_{r}\\U_{r}\\V_{r}\end{bmatrix}}}

The chrominance components can be, but do not necessarily have to be, down-scaled in resolution.

Wavelet transform

The color components are then wavelet transformed to an arbitrary depth. In contrast to JPEG 1992 which uses an 8x8 block-size discrete cosine transform, PGF uses one reversible wavelet transform: a rounded version of the biorthogonal CDF 5/3 wavelet transform. This wavelet filter bank is exactly the same as the reversible wavelet used in JPEG 2000. It uses only integer coefficients, so the output does not require rounding (quantization) and so it does not introduce any quantization noise.

Quantization

After the wavelet transform, the coefficients are scalar-quantized to reduce the amount of bits to represent them, at the expense of a loss of quality. The output is a set of integer numbers which have to be encoded bit-by-bit. The parameter that can be changed to set the final quality is the quantization step: the greater the step, the greater is the compression and the loss of quality. With a quantization step that equals 1, no quantization is performed (it is used in lossless compression). In contrast to JPEG 2000, PGF uses only powers of two, therefore the parameter value i represents a quantization step of 2i. Just using powers of two makes no need of integer multiplication and division operations.

Coding

The result of the previous process is a collection of sub-bands which represent several approximation scales. A sub-band is a set of coefficientsinteger numbers which represent aspects of the image associated with a certain frequency range as well as a spatial area of the image.

The quantized sub-bands are split further into blocks, rectangular regions in the wavelet domain. They are typically selected in a way that the coefficients within them across the sub-bands form approximately spatial blocks in the (reconstructed) image domain and collected in a fixed size macroblock.

The encoder has to encode the bits of all quantized coefficients of a macroblock, starting with the most significant bits and progressing to less significant bits. In this encoding process, each bit-plane of the macroblock gets encoded in two so-called coding passes, first encoding bits of significant coefficients, then refinement bits of significant coefficients. Clearly, in lossless mode all bit-planes have to be encoded, and no bit-planes can be dropped.

Only significant coefficients are compressed with an adaptive run-length/Rice (RLR) coder, because they contain long runs of zeros. The RLR coder with parameter k (logarithmic length of a run of zeros) is also known as the elementary Golomb code of order 2k.

Comparison with other file formats

There are several self-proclaimed advantages of PGF over the ordinary JPEG standard:[2]

Available software

The author published libPGF via a SourceForge, under the GNU Lesser General Public License version 2.0.[1] Xeraina offers a free Windows console encoder and decoder, and PGF viewers based on WIC for 32bit and 64bit Windows platforms. Other WIC applications including File Explorer are able to display PGF images after installing this viewer.[3]

Digikam is a popular open-source image editing and cataloging software that uses libPGF for its thumbnails. It makes use of the progressive decoding feature of PGF images to store a single version of each thumbnail, which can then be decoded to different resolutions without loss, thus allowing users to dynamically change the size of the thumbnails without having to recalculate them again.[citation needed]

See also

File extension

File extension .pgf and the TLA PGF are also used for unrelated purposes:

References

  1. ^ a b Christoph Stamm (2015). "PGF libPGF.org". SourceForge project. Retrieved 14 September 2015.
  2. ^ a b c Stamm, Christoph (2002). "PGF – A new progressive file format for lossy and lossless image compression" (PDF). Archived (PDF) from the original on 7 March 2007. Retrieved 12 April 2023.
  3. ^ "PGF download". xeraina. 2013. Retrieved 12 April 2023.
  • v
  • t
  • e
Raster
Raw
Vector
Compound
Metadata
  • v
  • t
  • e
Multimedia compression and container formats
Video
compression
ISO, IEC,
MPEG
ITU-T, VCEG
SMPTE
TrueMotion
Others
Audio
compression
ISO, IEC,
MPEG
ITU-T
IETF
3GPP
ETSI
Bluetooth SIG
  • SBC
  • LC3
Others
Image
compression
IEC, ISO, IETF,
W3C, ITU-T, JPEG
Others
Containers
ISO, IEC
ITU-T
IETF
SMPTE
Others
Collaborations
Methods
Lists
See Compression methods for techniques and Compression software for codecs