Skip to content

iFoxz17/Jpug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jpug

Implementation of a simple version of the JPG format.

DCT2

The dct2 folder contains a simple benchmark over different implementations of the Discrete Cosine Transform 2-dimensional algorithm.

JPUG

The jpug folder contains a CLI program that can be used for testing a simple version of the JPG format, whose details are described in doc/project.pdf.

Parameters

The three parameters used are:

  • $F \in \mathbb{N},$ $F > 0$: dimension of the blocks;
  • $d \in \mathbb{N},$ $0 < d \le 2F - 1$: first antidiagonal to exclude;
  • $mode \in {L, RGB}$: modality used in compression. L represents a gray-scale image and RGB a colored image.

Format

The program defines a custom format called jpug which is used to save the 'compressed' files. Images formats supported are:

  • Encoding:
    • Input: bmp
    • Output: jpug
  • Decoding:
    • Input: jpug
    • Output: bmp

CLI

The usage of the CLI is:

Main.py [path [param_1] [param_2] [param_3]] where:

  • .Main.py runs the CLI based program;
  • .Main.py path tries to encode or decode the file specified at path according to the file extension;
  • .Main.py path mode tries to encode or decode according to specified mode, which can be 'RGB' or 'L';
  • .Main.py path F d tries to encode or decode according to the specified parameters F and d, with the constraints
    • $F > 0$;
    • $0 < d \le 2F - 1$;
  • .Main.py path F d mode tries to encode or decode with the specified parameters F d and the specified mode.

Where not specified, the following default values are used:

  • $F = 8$
  • $d = 8$
  • mode = RGB

Dependencies

List of all the dependecies to run the program (can be installed with pip install):

  • numpy: Linear algebra for python;
  • PIL: Python Image Library;
  • pickle: Python object serialization;
  • fft: Fast Fourier Transform (dct2 implementation);
  • matplotlib: Large image visualization

To install all the dependencies run: pip install -r requirements.txt

About

Implementation of a simple version of the JPEG format

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •