Fred's ImageMagick Scripts
|
Generates a spectrum-like image from the colors in an image |
last modified: October 01, 2009
|
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.
|