Giter Club home page Giter Club logo

dmtools's Introduction

dmtools

PyPI pyversions CircleCI Documentation Status codecov

dmtools (Digital Media Tools) is a Python package providing low-level tools for working with digital media programmatically. It supports the PNG and Netpbm image file formats as well as the MPEG-4 and WAV video and audio file formats respectively.

The transform module provides image transformation tools such as rescale (based on the ImageMagick implementation) and composite (based on the Cairo implementation). The adjustments module provides a curves tool and the colorspace module provides colorspace conversion tools. The arrange module provides image layout tools. Lastly, the animation and sound modules provide tools for working with video and sound respectively. For more details, see the Documentation.

Installations

The quickest way to get started is with a pip install.

pip install dmtools

The animation module requires ffmpeg which you can install with a package manager like Homebrew. Note that this may take some time to install.

brew install ffmpeg

For in-depth installation instructions see Installation.

Usage

The usage example below illustrates how an image can be read, manipulated, and exported using dmtools. It features a change of color space, inversion of the red channel, and blur. For more usage examples, see the Introduction to dmtools in Tutorials. Both the input image checks_5.png and output image result.png can be found in the dmtools GitHub repository.

import dmtools
from dmtools import colorspace, transform, adjustments, arrange

image = dmtools.read("checks_5.png")
image = colorspace.gray_to_RGB(image)
image = adjustments.apply_curve(image, lambda x: 1 - x, 0)
image = transform.blur(image, 5)
image = arrange.image_grid([image]*2, 2, 1, 15, color=1)

dmtools.write_png(image, "result.png")

checks_5.png

checks_5.png

result.png

result.png

License

Licensed under the MIT License

dmtools's People

Contributors

dtorop avatar henryrobbins avatar

Watchers

 avatar

Forkers

dtorop

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.