Skip to main content

ImageMagick Preprocessor

This tool provides additional processing of images that referred in Markdown source, with ImageMagick.

Installation

$ pip install foliantcontrib.imagemagick

Config

To enable the preprocessor, add imagemagick to preprocessors section in the project config:

preprocessors:
    - imagemagick

The preprocessor has a number of options with the following default values:

preprocessors:
    - imagemagick:
        convert_path: convert
        cache_dir: .imagemagickcache

convert_path : Path to convert binary, a part of ImageMagick.

cache_dir : Directory to store processed images. These files can be reused later.

Usage

Suppose you want to apply the following command to your picture image.eps:

$ convert image.eps -resize 600 -background Orange label:'Picture' +swap -gravity Center -append image.jpg

This command takes the source EPS image image.eps, resizes it, puts a text label over the picture, and writes the result into new file image.jpg. The suffix of output file name specifies that the image must be converted into JPEG format.

To use the ImageMagick preprocessor to do the same, enclose one or more image references in your Markdown source between <<magick> and </magick> tags.

<<magick command_params="-resize 600 -background Orange label:'Picture' +swap -gravity Center -append" output_format="jpg">
(leading exclamation mark here)[Optional Caption](image.eps)
</magick>

Use output_format attribute to specify the suffix of output file name. The whole output file name will be generated automatically.

Use command_params attribute to specify the string of parameters that should be passed to ImageMagick convert binary.

Instead of using command_params attribute, you may specify each parameter as its own attribute with the same name:

<<magick resize="600" background="Orange label:'Picture' +swap" gravity="Center" append="true" output_format="jpg">
(leading exclamation mark here)[Optional Caption](image.eps)
</magick>

Metadata

Release files for foliantcontrib.imagemagick 1.0.2

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

Source distribution (sdist)

Source distribution for foliantcontrib.imagemagick 1.0.2
File Size Uploaded
foliantcontrib.imagemagick-1.0.2.tar.gz 3.7 kB Details

Built distribution (wheel)

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

Total release size: 8.6 kB

Release files / foliantcontrib.imagemagick-1.0.2.tar.gz

Download URL foliantcontrib.imagemagick-1.0.2.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
af558605eb6da8d0a384fe69dc637100de3bbbb8a55a309b4f5d89f545227f15
BLAKE2b-256 checksum
How to use checksums
e58d9c6b40de4b05e3b12231d3bb98225238e157cf6e9db375cf5b146fafa8ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Release files / foliantcontrib.imagemagick-1.0.2-py3-none-any.whl

Download URL foliantcontrib.imagemagick-1.0.2-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6e03df48d26a5b71a0fc364a21e3ed245d7d8de2f0fa74ea3fbf2e0eb750fc1
BLAKE2b-256 checksum
How to use checksums
4db007003bc87736282ada3f29742ba02bc5e9ac19a394cf75fbae284886bb5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

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