Giter Club home page Giter Club logo

imageio's Introduction

IMAGEIO

PyPI Version Supported Python Versions Build Status Coverage Status Documentation Status PyPi Download stats DOI

Website: https://imageio.github.io

Imageio is a Python library that provides an easy interface to read and write a wide range of image data, including animated images, video, volumetric data, and scientific formats. It is cross-platform, runs on Python 3.5+, and is easy to install.

Example

Here's a minimal example of how to use imageio. See the docs for more examples.
import imageio
im = imageio.imread('imageio:chelsea.png')  # read a standard image
im.shape  # im is a numpy array
>> (300, 451, 3)
imageio.imwrite('~/chelsea-gray.jpg', im[:, :, 0])

API in a nutshell

As a user, you just have to remember a handfull of functions:
  • imread() and imwrite() - for single images
  • mimread() and mimwrite() - for image series (animations)
  • volread() and volwrite() - for volumetric image data
  • get_reader() and get_writer() - for more control (e.g. streaming or compression)
  • See the user api for more information

Features

  • Simple interface via a consise set of functions.
  • Easy to install using conda or pip.
  • Few dependencies (only Numpy and Pillow).
  • Pure Python, runs on Python 3.5+, and Pypy
  • Cross platform, runs on Windows, Linux, macOS
  • Lots of supported formats.
  • Can read from file names, file objects, zipfiles, http/ftp, and raw bytes.
  • Easy to extend using plugins.
  • Code quality is maintained with many tests and continuous integration.

Dependencies

Minimal requirements:

  • Python 3.5+
  • Numpy
  • Pillow

Optional Python packages:

  • imageio-ffmpeg (for working with video files)
  • itk or SimpleITK (for ITK formats)
  • astropy (for FITS plugin)
  • osgeo (for GDAL plugin)

Still on an earlier version of Python? Imageio version 2.6.x supports Python 2.7 and 3.4.

Citing imageio

If you use imageio for scientific work, we would appreciate a citation. We have a DOI!

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

imageio for enterprise

Available as part of the Tidelift Subscription

The maintainers of imageio and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Details

Imageio has a relatively simple core that provides a common interface to different file formats. This core takes care of reading from different sources (like http), and exposes a simple API for the plugins to access the raw data. All file formats are implemented in plugins. Additional plugins can easily be registered.

Imageio provides a wide range of image formats, including scientific formats. Any help with implementing more formats is very welcome!

The codebase adheres to (a subset of) the PEP8 style guides. We strive for maximum test coverage (100% for the core, >95% for each plugin).

Contributing

Install a complete development environment:

pip install -r requirements.txt
pip install -e .

N.B. this does not include GDAL because it has awkward compiled dependencies

You may see failing test(s) due to missing installed components. On ubuntu, do sudo apt install libfreeimage3

Style checks, unit tests and coverage are controlled by invoke. Before committing, check these with:

# reformat code on python 3.6+
invoke autoformat
# check there are no style errors
invoke test --style
# check the tests pass
invoke test --unit
# check test coverage (re-runs tests)
invoke test --cover

imageio's People

Contributors

almarklein avatar blink1073 avatar kuchi avatar paulmueller avatar jni avatar hmaarrfk avatar thewtex avatar dennisvang avatar organicirradiation avatar landingellipse avatar arashrai avatar tdsmith avatar anntzer avatar ghisvail avatar jackwalker64 avatar jnises avatar rreilink avatar clbarnes avatar zulko avatar sunpoet avatar niklasrosenstein avatar kmilos avatar scivision avatar joesingo avatar hugovk avatar ginggs avatar geyang avatar fkohlgrueber avatar cdusold avatar who8mylunch avatar

Stargazers

pydude avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.