Skip to main content

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

Metadata

Release files for dmtools 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dmtools 0.5.0
File Size Uploaded
dmtools-0.5.0.tar.gz 24.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dmtools 0.5.0
File Interpreter ABI Platform
dmtools-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.5 kB

Release files / dmtools-0.5.0.tar.gz

Download URL dmtools-0.5.0.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ce0e69c01d8a16c5bf8927923ec0dba3c15124becf9d09b1e9368796d649913f
BLAKE2b-256 checksum
How to use checksums
257e49f6c73a0530c6d4059ed20294df83fcacc4f98f21fe57abe8670770a09c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8

Release files / dmtools-0.5.0-py3-none-any.whl

Download URL dmtools-0.5.0-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7b81ab5e4c2be6118462496a3b3e60893435b51c896cbe4c9771a96c8174454
BLAKE2b-256 checksum
How to use checksums
0ac31d171f1da02e43af2b43384968a6171432d59c2f2d7e05387012a45cc343
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page