GithubHelp home page GithubHelp logo

fatma-moanes / jpeg-compression Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 772 KB

This code implements a JPEG encoder and decoder for girl.png image with 8-bit grey scaled pixels

quantization huffman jpeg-encoder quantization-table jpeg-compression run-length-encoding discrete-cosine-transform zig-zag-scanning matlab

jpeg-compression's Introduction

JPEG-compression

This code implements a JPEG encoder and decoder for girl.png image with 8-bit grey scaled pixels, with the following steps:

Encoder:

1- Reads and divides the image into blocks of 8x8 pixels.

2- Performs DCT on each block.

3- Performs quantization step per 8x8 block using 3 different quantization tables.

4- Transforms each block from 2-D into 1-D vector using zig-zag pattern.

5- Performs run-length encoding to compress the stream of zeros that may result due to quantization.

6- Performs Huffman to encode the final stream into a further compressed bit stream.

Decoder:

7- Performs Huffman decoding to decode the Huffman encoded stream.

8- Performs run-length decoding.

9- Transforms the 1-D vector into groups of 8x8 matrices.

10- Multiplies each group by the quantization tables.

11- Performs IDCT on each 8x8 pixel group.

12- Combines the 8x8 pixel groups into a single image and saves it back to a file.

13- Compares the original image with the compressed image when using each quantization table in step (3).

Implemented functions:

  • DCT, IDCT
  • Quantization, Inverse Quantization
  • Zig-Zag scan, Inverse Zig-Zag scan
  • run-length encoding/ decoding
  • Huffman encoding

jpeg-compression's People

Contributors

fatma-moanes avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.