Python library to detect image type from a few bytes
Project description
whatimage
Python library to detect image type from a few bytes, focussed on webby formats (old and new)
Currently supports:
- JPEG
- WEBP
- GIF
- PNG
- HEIC
- AVIF
- BMP
- TIFF
- PGM/PGM/PPM
Installation
pip install whatimage
Usage
import whatimage
with open('image.jpg', 'rb') as f:
data = f.read()
fmt = whatimage.identify_image(data)
print(fmt)
'jpeg'
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
whatimage-0.0.3.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for whatimage-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82c752936fc0ca2a7b9a3ef2298d450bf1d8ea83127406d9efbd36c28961ec01 |
|
MD5 | 0022571abb558bbc799729df74898d44 |
|
BLAKE2b-256 | 6b8466f1cbaa0ea04cd4d5284bbbb64724d2cd17fb7f743e75ee46e98a953318 |