Skip to content

Convert multiple Images to a specific format (e.g. webp) using Python

License

Notifications You must be signed in to change notification settings

fatonsopa/convertify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is a package that converts images to a specified format. It searches recursively into a directory and converts all images.

Install

pip3 install convertify

Basic usage

convertify --source=/path/to/your/images/

Converted images will be saved one path behind the source, in a directory named "converted-images". You can change destination path by specifyind the path via ```--destination=``

from convertify import Convertify
Convertify.convert('<your-path-goes-here>')

Default Options:

  • source = <given-path>
  • destination = "../converted-images/"
  • from = {All file types}
  • to = "webp"
  • recursive = True

Advanced usage

convertify --source=/path/to/your/images/ --destination=/path/to/your/destination/ --from=png --to=webp --recursive=false
from convertify import Convertify
Convertify.convert(source_path='<your-source-path-goes-here>',
          destination_path='<your-destination-path-goes-here>',
          from_type=None,
          to_type='webp',
          recursive=True