Giter VIP home page Giter VIP logo

image-compression-using-svd's Introduction

Image-compression-using-svd

This is a Python application for image compression using Singular Value Decomposition (SVD). It allows users to select an image, specify a compression level using the k value, and save the compressed image. The application displays both the original and compressed images side by side. The compressed image is reconstructed using truncated SVD on the color channels of the original image. The application uses the Tkinter GUI toolkit and the Pillow library for image processing.

Installation

Install Image-compression-using-svd with

  git clone https://github.com/pannagkumaar/Image-compression-using-svd
  cd Image-compression-using-svd
  pip install -r requirements.txt
  

Usage

python3 compress.py
  • Click the "Browse" button to select an image to compress.
  • Enter the k value in the input field (recommended: 50-500).
  • Click the "Compress" button to compress the image.
  • Click the "Save Compressed Image" button to save the compressed image.
  • You can view the original image and the compressed image side by side in the application.

Features

  • A graphical user interface (GUI) created using the Tkinter library.
  • The ability to select an image to compress using a browse button.
  • An entry for the user to input the value of k (the number of singular values to keep during compression).
  • A compress button to initiate the image compression process.
  • A save button to save the compressed image.
  • The original image is displayed in one canvas and the compressed image is displayed in another canvas.
  • Uses the numpy and PIL libraries to perform Singular Value Decomposition (SVD) on the image to compress it.
  • Compresses each color channel of the image separately using SVD.
  • Uses the truncated SVD matrices to reconstruct the compressed color channels and create the compressed image.
  • Displays the compressed image in the GUI for the user to see.
  • Supports images in various formats including JPEG, PNG, BMP, and GIF.
  • Provides a recommended value range for k (50-500) to the user.
  • Includes error handling for cases when the user tries to compress an image before selecting one.
  • The code is organized into functions for better readability and maintainability.
  • The GUI layout is responsive and scales with the size of the window.

image-compression-using-svd's People

Contributors

pannagkumaar 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.