Skip to main content

pyimgconvert 1.0.10

Quick Overview

Python wrapper around Linux CLI “convert” which works as an entrypoint around the Linux image processing ‘ImageMagick’.

Overview

pyimgconvert is a Python utility which acts as a wrapper around the magick convert Linux CLI program that is useful for convert input images to the desired format and saves them in an output directory specified by the user.

This utility requires you to pass an inputDir, inputFile, outputDir, outputFile, and all the other optional CLI arguments that the convert accepts as a string to the args argument of pyimgconvert.

Assumptions

This document assumes UNIX conventions and a bash shell. The script should work fine under Windows, but we have not actively tested on that platform – our dev envs are Linux Ubuntu and macOS.

Installation

Python module

One method of installing this script and all of its dependencies is by fetching it from PyPI.

pip3 install pyimgconvert

Docker container

We also offer a docker container of pyimgconvert as a ChRIS-conformant platform plugin here https://github.com/FNNDSC/pl-imageconvert – please consult that page for information on running the dockerized container. The containerized version exposes a similar CLI and functionality as this module.

How to Use

mgz2imgslices needs at a minimum the following required command line arguments:

  • -I | --inputDir <inputDir>: The input directory which contains the input image that is to be converted

  • -i | --inputFile <inputFile>: The input image file to convert.

  • -O| --outputDir <outputDir>: The output directory which will store the output image

  • -o | --outputFile <outputFile>: The output file name (with extension) to save the output image

  • Optional: -a | --args "ARGS: <otherArgs>": Pass all the other arguments that convert accepts to this argument using the double quotes.

Examples

First, let’s create a directory, say devel wherever you feel like it. We will place some test data in this directory to process with this plugin.

cd ~/
mkdir devel
cd devel
export DEVEL=$(pwd)
  • Make sure your current working directory is devel. At this juncture it should contain the image file that you want to convert.

  • Create an output directory named results in devel.

mkdir results && chmod 777 results

Example-1

pyimgconvert
    --inputDir ${DEVEL}/                \
    --inputFile image.jpg               \
    --outputDir ${DEVEL}/results/       \
    --outputFile image.png              \

Example-2

pyimgconvert
    --inputDir ${DEVEL}/                            \
    --inputFile image.jpg                           \
    --outputDir ${DEVEL}/results/                   \
    --outputFile image.png                          \
    --args "ARGS: -colorspace RGB    -resize 40% "
  • The output image will be stored in the results directory.

Release files for pyimgconvert 1.0.10

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

Source distribution (sdist)

Source distribution for pyimgconvert 1.0.10
File Size Uploaded
pyimgconvert-1.0.10.tar.gz 5.7 kB Details

Release files / pyimgconvert-1.0.10.tar.gz

Download URL pyimgconvert-1.0.10.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
961c3c948b189cc6df6b04973767d27863fa305caf2242e999de739546a2ae5a
BLAKE2b-256 checksum
How to use checksums
e542c935759d80308afc908c5910c4868769167054f99d916ea27629237bbadc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5

Release history Release notifications | RSS feed

This release

1.0.10 This release

1 release file

1.0.8

1 release file

1.0.6

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.0

1 release file

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