Skip to content

KBNLresearch/jpeg-quality-demo

Repository files navigation

About

This repository contains all analysis scripts and data that are covered by the blog post JPEG Quality estimation: experiments with a modified ImageMagick heuristic.

Scripts

Below scripts were tested with Python 3.8.10. They use the Pillow Imaging Library, which can be installed using:

pip install pillow
  • test-jpegquality-im-original.py: computes JPEG quality for one or more files using original ImageMagick heuristic. Option --verbose prints out values of all variables in main loop at each iteration.
  • test-jpegquality-im-modified.py: computes JPEG quality for one or more files using modified ImageMagick heuristic. Option --verbose prints out values of all variables in main loop at each iteration.
  • test-jpegquality-tablematch.py: computes JPEG quality for one or more files using direct comparison against standard JPEG quantization tables.
  • test-jpegquality-compare.py: computes JPEG quality for one or more files using all of the above methods and write results in comma-delimited format.
  • generate-testimages-pillow.py: generates a set of JPEG images at 6 quality levels from a user-defined source image.
  • generate-testimages-im.sh: generates a set of JPEG images at 6 quality levels from a user-defined source image using ImageMagick.
  • test-quantization.py: reads the quantization tables of one or more files and writes the values to 2 comma separated text files.

Both quality estimation scripts are derived and modified from the Python port of ImageMagick's heuristic by Eddy O (AKA "eddygeek"). In turn this port is based on ImageMagick's original code.

Data

The directory images contains the following folders:

  • im_pil: test images created with Python's Pillow library and and ImageMagick. Each image is compressed at level indicated in filename.
  • source: source images for all Pillow and ImageMagick test images.
  • dbnl: examples of problematic access and master JPEGs from DBNL scans.
  • misc: miscellaneous images, most of these give different quality estimates depending on which tool/method is used.

Image attribution

About

Test scripts and resources for jpeg quality assessment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published