semvec/pypi-packages huggingface dataset:
whatimage 0.0.3
Python library to detect image type from a few bytes

# 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
```python
import whatimage

with open('image.jpg', 'rb') as f:
    data = f.read()
fmt = whatimage.identify_image(data)
print(fmt)
```
> 'jpeg'