UnBlock is an algorithm I invented in late 2005 that seeks to remove the “blockiness” of heavily or moderately compressed JPEG images, without degrading the sharpness of the original image, and without the need for any “tuning” or “tweaking”: the algorithm learns about the block edges from the image itself. The algorithm is described in detaiil in the following research paper:
A reference ANSI C implementation of UnBlock is provided at the bottom of this page.
UnBlock has also been used by other researchers on video formats that use a similar block encoding to JPEG. Those results are not contained on this page.
At the time I released UnBlock (early 2006), the best existing automatic deblocking filter commercially available was from Pegasus Imaging. Click here to see a “head-to-head” between Pegasus and UnBlock, that I created at the time. (The President of Pegasus Imaging publicly stated at that time that UnBlock also out-performed Pegasus’s own new patented but unreleased deblocking algorithm.)
The following sample results have been on this page since 2006, but the actual images now shown below have been generated using the ANSI C code below.
The original JPEG-compressed file, at the corresponding JPEG quality setting (using the standard IJG JPEG library), is on the left; the UnBlocked image obtained from running that JPEG image through UnBlock is on the right. The compression ratios are relative to the uncompressed (e.g. BMP) image file size. For the higher-quality originals, discerning the block artifacts may be easier if you download the actual image files, as zooming on your browser may mask some of those artifacts.
JPEG quality 0 (104:1 compression)
JPEG quality 5 (83:1 compression)
JPEG quality 10 (60:1 compression)
JPEG quality 20 (41:1 compression)
JPEG quality 60 (22:1 compression)
JPEG quality 80 (14:1 compression)
JPEG quality 90 (10:1 compression)
JPEG quality 95 (6.8:1 compression)
JPEG quality 100 (3.2:1 compression)
The reference implementation of UnBlock is contained in the following ANSI C code:
There is one sample program included:
There are also 57 executables of unit tests and death tests provided.
Instructions for building the code are contained in the _README file within the archive.
Note that all code provided here is from my personal codebase, and is supplied under the MIT License.
If you like UnBlock, then you may also find useful the following image processing resources that I have put into the public domain over the decades:
This page describes personal hobby research that I have undertaken since 2005. All opinions expressed herein are mine alone. I put UnBlock into the public domain, via this page and its predecessor on my previous domain, in early 2006. All code provided here is from my personal codebase, and is supplied under the MIT License.
© 2005–2022 John Costella