Toolkit for converting image files
Project description
Toolkit for converting image files
Installation
python -m pip install image_file_converter
Usage in Python
from image_file_converter.core import ImageFileConverter
# convert pdf to image or data_url
input_file = 'tests/test.pdf
converter = ImageFileConverter(input_file, dpi=300, max_page=5)
converter.to_image('output.png')
converter.to_image('output.jpg')
data_url = converter.to_data_url()
print(data_url)
# convert image to pdf or data_url
input_file = 'tests/test.png'
converter = ImageFileConverter(input_file)
converter.to_pdf('output.pdf')
data_url = converter.to_data_url()
print(data_url)
Usage in Jupyter Notebook
from image_file_converter.core import ImageFileConverter
# convert pdf to image or data_url
input_file = 'tests/test.pdf'
Usage in CMD
image_file_converter --help
image_file_converter --version
# convert pdf to image
image_file_converter to_image tests/test.pdf -o output.png
image_file_converter to_image tests/test.pdf -o output.jpg
image_file_converter to_image tests/test.pdf -o output.png --dpi 300 --max-page 5
# convert image to pdf
image_file_converter to_pdf tests/test.png -o output.pdf
# convert image or pdf to data_url
image_file_converter to_data_url tests/test.png
image_file_converter to_data_url tests/test.pdf
image_file_converter to_data_url tests/test.pdf --dpi 300 --max-page 5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file image_file_converter-1.0.0.tar.gz
.
File metadata
- Download URL: image_file_converter-1.0.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc8a89a0741f3abb8bbfc17518c504a0be0c41d2eef6a2d9d6719600b894a5bf |
|
MD5 | 6c38c623b47800f6f6435d59362e5669 |
|
BLAKE2b-256 | fcdfcc86146ecae4b21b5ca5a3c618491351b2673bdd3d1f0799ef3ec083502f |
File details
Details for the file image_file_converter-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: image_file_converter-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dff3159a27c3d938c098eff1341d20754d1651cace2c7e31a7d86c82fe5f5bda |
|
MD5 | 01604bf76b407970c49ad99250823c66 |
|
BLAKE2b-256 | ddebfdb3d321fba1c524c20c5921d595b1fa8921bc5c717053ccf4dc89c53838 |