Skip to main content

Python lib to read width and height of image files

Project description


A pure Python library for reading the width and height of images.


`pip install dimensions`



For a single image:

> dimensions src/sample.png
width: 405
height: 239
content_type: image/png

Wildcards also work (escape \* in markdown for PyPi RST...):

> dimensions src/\*.png
width: 405
height: 239
content_type: image/png
width: 473
height: 469
content_type: image/png

As always, full details are available via `dimensions -h`.

In Python code, simply call `dimensions.dimensions`. If you provide a
sequence of filenames, you get back a sequence of tuples; if you provide
just a single filename, you get back a single tuple.

import dimensions
dims = dimensions.dimensions('./src/sample.png')
# (405, 239, 'image/png', './src/sample.png')


- release newer version to PyPi

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dimensions, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size dimensions-0.0.2.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page