Skip to main content

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)

Release files for imagecompress-svd 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imagecompress-svd 0.1.2
File Size Uploaded
imagecompress_svd-0.1.2.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imagecompress-svd 0.1.2
File Interpreter ABI Platform
imagecompress_svd-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.0 kB

Release files / imagecompress_svd-0.1.2.tar.gz

Download URL imagecompress_svd-0.1.2.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bab8a1e4ca7209f5b9dde0b4ab4fc3b9faa0384803d2f51a814b2b3b2ca94f57
BLAKE2b-256 checksum
How to use checksums
a65531b6cc1952698cf547c16a5c8905ddb38240159f2d8c11a1aabbae0e0945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.7

Release files / imagecompress_svd-0.1.2-py3-none-any.whl

Download URL imagecompress_svd-0.1.2-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c19520047a4326468fb9645c6579f94b2b0f1fd47a24f31256b173bd4327812f
BLAKE2b-256 checksum
How to use checksums
20967f7d06d1cac2c98ac285653b0ff51aa177ac644452271758bf9c7c6e26fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page