Skip to content

An ImageMagick orchestrator to help easily perform commands for image repositories using declarative configuration and executed via CLI. [This is a mirror from GitLab, please interact with the repository there.]

License

Notifications You must be signed in to change notification settings

elypia/imagecaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ImageCaster

Matrix Discord Docker Build Coverage Donate

About

ImageCaster is a small CLI application that can be used to manage exporting images. It's primary use case is for CI/CD where a repository that has a set of images as a source and programmatically produces images as a result of a build.

An example and motivation for this is the Elypia Emotes repository where we have many images, which we'd like exported in many sizes and colors, as well as to dynamically generate montages to display on the project README.

This project is not an alternative to Magick.NET or ImageMagick, it is a different way of interfacing with them. If you're looking for a programming interface then you may prefer Magick.NET, or if you're looking for a tool executed purely from CLI, please visit ImageMagick. ImageCaster is an abstraction of the two to provide the features though a declarative configuration file instead for simpler CI/CD usage as well as some management for consecutive builds and quality assurance.

Download

There are 3 versions available of ImageCaster which correlate with the 3 ImageMagick versions. Q16-HDRI is the default version and recommended for general use, however Q16 and Q8 are available for environments where limited resources are available, or minimal resource usage and build times are critical so long as they are appropriate for your use case. More information can be found here on the ImageMagick website.

ImageCaster Command Line Interface (CLI)

Download Q16-HDRI Download Q16 Download Q8

ImageCaster Server

Download Q16-HDRI Download Q16 Download Q8

Features

  • Instead of scripting, define a declarative configuration that describes the output you want.
  • Quicker consecutive builds, ImageCaster will manage if changes occurred and if re-exported again is required.
  • Set Exif data for output, for example the Copyright or Artist tag.
  • Define patterns (directory/glob/regex) to match images and create montages to display to users.
  • Define patterns (directory/glob/regex) to match images and archive images for download.
  • Define checks to ensure your repository standards are maintained and to avoid mistakes like mismatching names.

Example

Simple

build:
  input:
    - twitch/emotes/
  sizes:
    dimensions: [112, 56, 28]

Build all of the images made in the 3 sizes, 112px, 56px, and 28px.

Advanced

build:
  input:
    - src/emotes/
  metadata:
    exif:
      - {tag: Artist, value: Elypia CIC and Contributors}
  resize:
    filter: Catrom
    geometries: [512, 258]
  recolor:
    mask:
      sources:
        - src/masks/
    modulation:
      - {name: blue, hue: 0}
      - {name: violet, saturation: 70, hue: 50}
checks:
  file-exists:
    source: regex:src/mask/(.+?)\\..+
    target: src/emotes/
    pattern: $1.png

First we define a pattern which matches all of our input images. For each image we add the Exif tag, Artist, and export 6 versions of each image to accommodate original, blue, and violet colors, in 512px, and 128px sizes. Doing imagecaster build will do all of this for you. You may wish to use imagecaster check first to perform all checks, in this case only one check is defined which states if a mask exists, then an image must also exist with the respective name. By default the full filename is $0, the main name

Open-Source

This project is open-source under the Apache 2.0 license! While not legal advice, you can find a TL;DR that sums up what you're allowed and not allowed to do along with any requirements if you want to use or derive work from this repository!

About

An ImageMagick orchestrator to help easily perform commands for image repositories using declarative configuration and executed via CLI. [This is a mirror from GitLab, please interact with the repository there.]

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages