Skip to content

Analysis of the effects of approximating an image with a partial set of DCT coefficients.

License

Notifications You must be signed in to change notification settings

javiribera/jpeg-encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JPEG encoder-decoder

This script is intended to be used solely for academic purposes:

  1. Analysis of the effects of approximating an image with a partial set of DCT coefficients. It applies a 8x8 pixels block DCT and keeps only the first K selected coefficients. The IDCT of these coefficients is shown and image quality assessment metrics are computed.

  2. Analysis of the effects of quantizing the DCT coefficients of an image using the JPEG quantization matrix and the provided scaling factor. The IDCT of the quantized coefficients is shown and image quality assessment metrics are computed. No subsamping us applied (4:4:4)

More info: https://en.wikipedia.org/wiki/JPEG#JPEG_codec_example


Requirements

  • Python3. Tested with 3.9.12
  • Python3 pip
  • Python3 venv

Usage

Create an environment to install the required pip3 packages

python3 -m venv env

Activate the environment

source env/bin/activate

Install the required packages

pip3 install -r requirements.txt

Run the script and pass an image as an argument

python3 main.py --input <path_to_image> --coeffs <number_of_coefficients>

Example

python3 main.py --input ~/Pictures/flowers.jpg --coeffs 16

About

Analysis of the effects of approximating an image with a partial set of DCT coefficients.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages