Giter Site home page Giter Site logo

jpeg-encoder's Introduction

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
  • 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.