Introduction to libjpeg-turbo

libjpeg-turbo is a fork of the original IJG libjpeg which uses SIMD to accelerate baseline JPEG compression and decompression. libjpeg is a library that implements JPEG image encoding, decoding and transcoding.



Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

libjpeg-turbo Dependencies




Installation of libjpeg-turbo

Install libjpeg-turbo by running the following commands:

mkdir build &&
cd    build &&

cmake -DCMAKE_INSTALL_PREFIX=/usr        \
      -DENABLE_STATIC=FALSE              \
      -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/libjpeg-turbo-3.0.1 \
      .. &&

To test the results, issue: make test.

Now, as the root user:

make install

Command Explanations

-DCMAKE_SKIP_INSTALL_RPATH=ON: This switch makes cmake remove hardcoded library search paths (rpath) when installing a binary executable file or a shared library. This package does not need rpath once it's installed into the standard location, and rpath may sometimes cause unwanted effects or even security issues.

-DWITH_JPEG8=ON: This switch enables compatibility with libjpeg version 8.


Installed Programs: cjpeg, djpeg, jpegtran, rdjpgcom, tjbench, and wrjpgcom
Installed Libraries: and
Installed Directories: /usr/share/doc/libjpeg-turbo-3.0.1

Short Descriptions


compresses image files to produce a JPEG/JFIF file on the standard output. Currently supported input file formats are: PPM (PBMPLUS color format), PGM (PBMPLUS gray-scale format), BMP, and Targa


decompresses image files from JPEG/JFIF format to either PPM (PBMPLUS color format), PGM (PBMPLUS gray-scale format), BMP, or Targa format


is used for lossless transformation of JPEG files


displays text comments from within a JPEG file


is used to benchmark the performance of libjpeg-turbo


inserts text comments into a JPEG file

contains functions used for reading and writing JPEG images