Project Description
An optimized implementation of the JPEG-LS standard for lossless and near-lossless image compression. JPEG-LS is a low-complexity standard that matches JPEG 2000 compression ratios. In terms of speed, CharLS outperforms open source and commercial JPEG LS implementations.

About this software
This project's goal is to provide a full implementation of JPEG-LS. This library is written from scratch in portable C++. All mainstream JPEG-LS features are implemented by this library.
According to preliminary test results published on, CharLS is about twice as fast as the original HP code, and beats both JPEG-XR and JPEG 2000 by a factor 3.

News Section

Post 1.0 activity
The git repository is used for day to day development. Usually it builds on Windows. Linux is tested less regular.
  • The new 2.0 version is based on C++ 11. The 1.x branch will be maintained in C++ 03.
  • Work is in progress to decompress from streams ("direct to/from disk") based on the C++ IO classes.
  • Decompression of rectangular regions from huge images
  • Direct decode to/from pgm/ppm images for the test application.
Soon these activities will be rolled into a 2.0 release.

Users & Acknowledgements
CharLS is being used by gdcm dicom toolkit, thanks for Matthieu for getting CharLS started on Linux. Kato Kanryu wrote an initial version of the color transfroms and the DIB output format code, for an irfanview plugin using CharLS. Thanks to Uli Schlachter, CharLS now finally runs correctly on big-endian architectures like sun SPARC.

Supported platforms
The code is regularly compiled/tested on Visual Studio 2013, and 64 bit Linux. Additionally, the code has been successfully tested on Linux Intel/AMD 32/64 bit (slackware, debian, gentoo), Solaris SPARC systems, Intel based Macs and Windows CE (ARM cpu, emulated), where the less common compilers may require minor code edits. It leverages C++ language features (templates, traits) to create optimized code, which generally perform best with recent compilers. If you compile with GCC, 64 bit code performs substantially better.

Documentation Links
JPEG-LS (ISO-14495-1/ITU-T.87) is a standard derived from the Hewlett Packard LOCO algorithm. JPEG LS has low complexity (meaning fast compression) and high compression ratios, similar to JPEG 2000. JPEG-LS is more similar to the old Lossless JPEG than to JPEG 2000, but interestingly the two different techniques result in vastly different performance characteristics.
Wikipedia on lossless JPEG and JPEG-LS:
Benchmarks: JPEG-LS-Performance

The code in this project is available through a BSD style license, allowing use of the code in commercial closed source applications if you wish. All the code in this project is written from scratch, and not based on other JPEG-LS implementations. Be aware that Hewlett Packard claims to own patents that apply to JPEG-LS implementations, but they license it for free for conformant JPEG-LS implementations. Read more at before you use this if you use this code for commercial purposes.

Last edited Nov 15, 2014 at 3:39 PM by vbaderks, version 24