Skip to main content

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


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)

Uploaded Source

Built Distribution

whatimage-0.0.3-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page