Fred's ImageMagick Scripts
|
Generates a spectrum-like image from the colors in an image |
last modified: May 30, 2008
|
USAGE: colorspectrum [-c columns] [-r rows] [-l] infile outfile
-c ...... columns .... width of spectrum; determines the maximum PURPOSE: To generate a spectrum-like image from the colors in an image. DESCRIPTION: PROFILE generates generate a spectrum-like image from the colors in an image. It uses a color reduction algorithm to extract the specified number of colors. Then it sorts the colors according to hue and creates an image of the specified height and width. See http://www.imagemagick.org/script/quantize.php for a description of the color reduction algorithm. ARGUMENTS: -c columns ... COLUMNS is the width of the spectrum and also determines the number of colors to try to generate. Allowed values are integers between 1 and 255. Note that it is possible that the color reduction algorithm will produce fewer, but never more colors than desired. If fewer colors are generated, then they will show as black areas on the left side of the spectrum. The default is 255. -r rows ... ROWS is the height of the spectrum. Values are integers greater than 0. The default is 100. -l ... Indicates to print a list of colors to the terminal. 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. |
|
Image And Spectrum | |
|
Original Image |
Spectrum Image |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
What the script does is as follows:
This is equivalent to the following IM commands:
|