Colorfield is a simple command-line tool for creating an array of related colors. It does this by randomly marching through either an RGB or HSV colorspace. Options control the spatial and color variance, and output is to a PNG file. It is a single ANSI C file and requires only the PNG libraries.
The current version of Colorfield is 0.1. You can download it here: colorfield.c. On Linux, build it with:
on OSX, if you have Xcode installed, you can do:
gcc -o colorfield colorfield.c -lm -lpng -O3 -ffast-math
or, to cross-compile for Windows on Linux, try:
gcc -o colorfield colorfield.c -I/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include -L/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib -lm -lpng -O3 -ffast-math
i386-mingw32-gcc -o colorfield.exe colorfield.c -lm -lpng -O3 -ffast-math
Colorfield supports the following options:
- -rgb March through RGB colorspace.
- -hsv March through HSV (hue, saturation, value) colorspace.
- -8 Write 8-bit-per-channel PNG image.
- -16 Write 16-bit-per-channel PNG image.
- -color Write a color image.
- -gray Write a grayscale image.
- -y [res] Colors vary in the y (vertical) direction, the number of pixels in the image is the number of colors.
- -x [res] Every row is the same color, so it really doesn't matter how wide the image is. Nevertheless, you can set that here.
- -b [r] [g] [b] Set baseline color (use RGB triple). The colors will be centered around this color, but may not necessarily include this color.
- -n [val] [val] [val] Set the "time constant" for each channel. Expect each channel to vary across its range in this number of pixels/colors. This defaults to 100.
- -s [val] [val] [val] Set the variance scale (magnitude) of change for each channel. Use "0.0" if you don't want the channel to change value at all. Use "1.0" for a moderately large variance from average, "10.0" for drastic change.
- -seed [num] Change the random seed. This will change the resulting colors, sometimes substantially.
Panchromatic scale using RGB:
colorfield -seed 259 -x 1025 -y 1025 -rgb
A nice set of blues stumbled upon by the random walker:
colorfield -seed 259 -x 1025 -y 1025 -hsv -n 400 400 400
March through HSV space, faster through value than other dimensions:
colorfield -hsv -x 200 -y 1000 -8 -s 0.2 0.2 0.5 -n 10000 100 100
A set that mainly clipped to black:
colorfield -hsv -8 -b 0.18 0.15 0.14 -n 11000 100 30 -s 0.01 1.0 1.5
Future versions of Colorfield may include the following:
- Support for marching across different color spaces
- Wrappable sequences
- Maybe a GUI?
Please e-mail me if you'd like to see some particular feature in Colorfield, or if you use it to make something creative.