Skip to main content

Join the wonderland of python, and decode all your images in a numpy compatible way

Project description

redpil

pypi Travis Docs

Join the wonderland of python, and decode all your images in a numpy compatible way.

Pillow's memory system isn't compatible with numpy. Meaning that everytime you read or write images, they get copied to a Pillow array, then again to a numpy array.

For large images, this is a serious bottleneck.

Supported file formats

Future file formats

  • BMP: more coverage
  • JPEG, JPEG2000
  • GIF
  • PNG
  • SVG
  • TIFF

Benchmarks

I don't have a fancy benchmarking service like scikit-image or dask has, but here are the benchmarks results compared to a PIL backend. This is running on my SSD, a Samsung 960 Pro which claims it can write at 1.8GB/s. This is pretty close to what redpil achieves.

8 bit BMP grayscale images

Saving images:

================ ============ =============
--                          mode           
---------------- --------------------------
     shape          pillow        redpil   
================ ============ =============
   (128, 128)      263±4μs       106±2μs   
  (1024, 1024)    1000±60μs      787±90μs  
  (2048, 4096)    5.15±0.2ms   4.62±0.07ms
 (32768, 32768)    510±10ms      470±3ms   
================ ============ =============

Reading image

================ =========== =============
--                          mode          
---------------- -------------------------
     shape          pillow       redpil   
================ =========== =============
   (128, 128)      306±7μs      120±2μs   
  (1024, 1024)    990±300μs     187±7μs   
  (2048, 4096)     3.53±1ms   1.39±0.04ms
 (32768, 32768)    242±7μs      369±4ms   
================ =========== =============

Note, Pillow refuses to read the 1GB image because it thinks it is a fork bomb.

History

0.0.1 (2018-09-22)

  • First release on PyPI.

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

redpil-0.0.2.tar.gz (27.2 kB view hashes)

Uploaded Source

Built Distribution

redpil-0.0.2-py2.py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 2 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