Fred's ImageMagick Scripts



    Licensing:

    Copyright © Fred Weinhaus

    My scripts are available free of charge for non-commercial (non-profit) use, ONLY.

    For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net.

    If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment.

    Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php

    Please read the Pointers For Use on my home page to properly install and customize my scripts.

FLICKERCHANNEL


Displays and optionally save an animation of the channels in an image.

Download Script

last modified: December 15, 2018



USAGE: flickerchannel [-c channellist] [-d delay] [ -r resize] [-m colormodel] [-i] [-l] [-f] infile
USAGE: flickerchannel [-h or -help]

-c ... channellist .... doubled quoted list of channels; 0, 1, 2 (or 3);
....................... any two or three may be specified;
....................... default "0 1 2 3" for CMYK; otherwise "0 1 2"
-d ... delay .......... time delay per frame (ms); delay >= 0; default=50
-r ... resize ......... image resize percentage; resize > 0;
....................... default=100 (unchanged)
-m ... colormodel ..... desired color space to convert (RGB/sRGB) image;
....................... default is infile colorspace: RGB/sRGB or CMYK
-i .................... includes the full color image in the animation
-l .................... disables the labeling of the images
-f .................... saves the animation to file animation.gif

PURPOSE: To display and optionally save an animation of the channels in an image.

DESCRIPTION: FLICKERCHANNEL automatically displays an animation from the channels of the supplied input image and optionally saves the animation to a file. At least two channels must be supplied. The main purpose of the script is to make a visual inspection of two (or more) channels of an image by alternating the display of each channel. The input image must be sRGB/RGB or CMYK. It may optionally be converted to any other valid colorspace by the script before the channels are labeled and displayed.

ARGUMENTS:

-c channellist ... CHANNELLIST is a double quoted list of the channels to be included in the animation. For CMYK, this defaults to "0 1 2 3", but can be any pair. For RGB or any other colorspace, this defaults to "0 1 2", but can be any pair.

-d delay ... DELAY is the time delay in msec between frames in the animation. Values are integers greater than or equal to zero. The default=10. Note that the animation will be created to loop forever.

-r resize ... RESIZE allows the animation to made larger or smaller than the input image size. The values are integers greater than 0 representing the resize percentage. The default=100 which leaves the animation the same size as the input image.

-m COLORMODEL is the desired color model in which to present the animation. Any valid IM colorspace is permitted, but if used, the infile must be in RGB/sRGB or CMYK colorspace. The default is the input colorspace.

-i ... Includes the full color infile in the animation.

-l ... Disables the labeling of the images.

-f ... Specifies that the animation is to be saved to a file called animation.gif

CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk.


EXAMPLES


Various Channel Animations

Original Image

Arguments:
-f

Arguments:
-f -i

Arguments:
-f -c "0 2"

Arguments:
-f -l

Arguments:
-f -m CMYK

Arguments:
-f -m HSL

Arguments:
-f -m OHTA

 

 


What the script does is as follows:

  • Converts to desired colorspace
  • Optionally labels and resizes each input
  • Adds each input as a frame of an animation
  • Optionally saves the animation to an output file
  • Displays the animation using -animate

This is equivalent to the following IM commands when the images
are saved at 100%:

  • convert $infile -colorspace -separate $channel-$d
  • For the first $channel-0:
    convert $label $channel-0 -resize 100% miff:- |\
    montage - -geometry +0+0 -tile 1x1 $tmpC
  • For each successive channel(N):
    convert $label $channel-N -resize 100% miff:- |\
    montage - -geometry +0+0 -tile 1x1 miff:- |\
    convert -delay 50 $tmpC -page +0+0 - -page +0+0 $tmpC
  • convert $tmpC -loop 0 animation.gif
  • animate $tmpC