Skip to content

avylove/imagesize_py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imagesize

https://travis-ci.org/shibukawa/imagesize_py.svg?branch=master

This module analyzes jpeg/jpeg2000/png/gif image header and return image size.

import imagesize

width, height = imagesize.get("test.png")
print(width, height)

This module is pure python module.

API

  • imagesize.get(filepath)

    Returns image size(width, height).

Benchmark

It just parses only header, ignores pixel data. So it is much faster than Pillow.

module result
imagesize(pure python) 1.077 seconds per 100000 times
Pillow 10.569 seconds per 100000 times

I tested on MacBookPro(2014/Core i7) with 125kB PNG files.

License

MIT License

Thanks

I refers the following codes:

Thank you for feedbacks:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%