Skip to main content

A Python package for image compression using Singular Value Decomposition (SVD).

Project description

Image Compression

Overview

imagecompress_svd is a Python package that compresses images using Singular Value Decomposition (SVD). It provides functions to convert RGB images to grayscale, compress images by retaining a specified number of singular values, and visualize the compressed images.

Features

  • Convert RGB images to grayscale.
  • Compress images using SVD with adjustable singular values.
  • Visualize the compressed images for different levels of compression.

Installation

To install the package, first clone the repository or download the code, then navigate to the package directory and run:

pip install .

Usage

from imagecompress_svd import rgb2gray, plot_compressed_images
from PIL import Image
import numpy as np

# Load image and convert to grayscale
image = Image.open('your_image.jpg')
gray_image = rgb2gray(np.array(image))

# Define different k values for compression
k_values = [1, 2, 5, 10, 20, 50]

# Plot compressed images
plot_compressed_images(gray_image, k_values)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imagecompress_svd-0.1.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imagecompress_svd-0.1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file imagecompress_svd-0.1.2.tar.gz.

File metadata

  • Download URL: imagecompress_svd-0.1.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for imagecompress_svd-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bab8a1e4ca7209f5b9dde0b4ab4fc3b9faa0384803d2f51a814b2b3b2ca94f57
MD5 990e1815b05ee8184fd0b2076bc6bb44
BLAKE2b-256 a65531b6cc1952698cf547c16a5c8905ddb38240159f2d8c11a1aabbae0e0945

See more details on using hashes here.

File details

Details for the file imagecompress_svd-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for imagecompress_svd-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c19520047a4326468fb9645c6579f94b2b0f1fd47a24f31256b173bd4327812f
MD5 06ccee8dc79ad35ede01350292a8152e
BLAKE2b-256 20967f7d06d1cac2c98ac285653b0ff51aa177ac644452271758bf9c7c6e26fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page