imColour {imageUtilities} | R Documentation |
colourise an image according to a custom colour scale, returning calculated image.
imColour(img, colours, bias = 1, max = imageUtilities.option("max"))
img |
single-channel input image to colourise |
colours |
vector of colour names you want the scale to have, in ascending order. |
bias |
The colours will be raised to the power of 'bias' before being scaled. Default 1 (linear color ramp). Choosing 'bias'<1 gives more widely spaced colours at the low end. Choosing 'bias'>1 gives more widely spaced colours at the high end. |
max |
the max intensity of the input image (will be used for output image too). |
image of same dimensions as input except 3 channels. The
intensities range from 0 to max
.
this really will only work for a single-channel input image.
## Not run: img <- array(runif(100),dim=c(10,10)) # see the grayscale image drawImage(img,max=1) # apply a new map. colourised <- imColour(img,c('black','red','orange','yellow','white'), max=1) drawImage(colourised,max=1) ## End(Not run)