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. |
Generates a spectrum-like image from the colors in an image |
last modified: December 15, 2018
USAGE: colorconverter -c "color" [-d dimensions] [-s] [-v]
-c .... color ......... Any valid IM color specification PURPOSE: To convert any valid ImageMagick color specification to the other ImageMagick color representations. DESCRIPTION: COLORCONVERTER converts any valid ImageMagick color specification to other ImageMagick color representations, including: RGB, HEX, HSL, HSB and CMYK. The values will be listed to the Terminal. A color swatch for the input color may be displayed. Also a swatch for each of the other color representations may be displayed. ARGUMENTS: -c color ... COLOR is any valid IM color specification, including RGB, HEX, HSL, HSB, CMYK or by name. If not a color name, the color specification should be enclosed in quotes. -d dimensions ... DIMENSIONS specifies the WidthxHeight for the color swatch(es). The default="150x150". -s ... Indicates to display a color swatch for the specified color. -v ... Indicates to display a color swatch for each converted color in the various color representations. NOTE: Prior to IM 6.5.6-6, HSL colors may not produce correct swatches, as changes and bugs were fixed starting with IM 6.5.6-4. Prior to IM 6.5.6-4, HSL colors were specified only with hue in range 0-360 and saturation and lightness as percentages. HSB color specification and swatches were only first available and correct starting with IM 6.5.6-6. 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. |
Text Output |
Color Swatch |
colorconverter -c wheat -s |
Text Output |
Color Swatch |
colorconverter -c "rgb(0,0,255)" -s |
Text Output |
Color Swatch |
colorconverter -c "#FFFF00" -s |
Text Output |
Color Swatch |
colorconverter -c "hsl(120,255,127.5)" -s |
Text Output |
Color Swatch |
colorconverter -c "hsb(83.3341%,100%,100%)" -s |
Text Output |
Color Swatch |
colorconverter -c "cmyk(255,0,0,0)" -s |
What the script does is as follows:
This is equivalent to the following IM commands for the RGB components.
|