Skip to content

sarimbinwaseem/rsimageconvertor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

Compression is not stable. Huge errors in implementation will destroy the output.

RS Image Convertor

Using rawpy, imageio and pyheif

Install directly from github:

pip install git+https://github.com/sarimbinwaseem/rsimageconvertor.git@main

Convertor

Import and run

from rsimageconvertor.convertor import Convertor
con = Convertor()
  1. For one image
con.convertOne("path/to/image.<heic, dng, etc>")
  1. For entire folder
con.convertAll("path/to/folder")

A prompt will ask for PNG or JPEG file format
Simply type png or jpg

Size Compression

Compresses size on disk with minimum impact on resolution and quality.

con.compressOne("path/to/image.<ext>", size = 2000, form  = "same")

path: path to image
size: maximum size needed with miniumum resize of picture
form: save as PNG or JPG or any other PIL supported format, if "same" is passed, final image will be in same format as original.