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 details)
Built Distribution
File details
Details for the file whatimage-0.0.3.tar.gz
.
File metadata
- Download URL: whatimage-0.0.3.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f30a3395929fc9b399fa444bacea14606c9a19e02f595f48c110aa39c0841432 |
|
MD5 | 3da3eaf69c0b62a6cfb906502eed3859 |
|
BLAKE2b-256 | e9acbc71e49fd15ffd9dc6622ad26b0b77baeafb32954d553855ca36a705e66d |
File details
Details for the file whatimage-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: whatimage-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82c752936fc0ca2a7b9a3ef2298d450bf1d8ea83127406d9efbd36c28961ec01 |
|
MD5 | 0022571abb558bbc799729df74898d44 |
|
BLAKE2b-256 | 6b8466f1cbaa0ea04cd4d5284bbbb64724d2cd17fb7f743e75ee46e98a953318 |