# create three images with values in [0,1]
X <- setcov(owin())
Y <- as.im(function(x,y){(x+1)/2}, W=as.owin(X))
Z <- as.im(function(x,y){(y+1)/2}, W=as.owin(X))
RGB <- rgbim(X, Y, Z, 1)
HSV <- hsvim(X, Y, Z)
plot(RGB, valuesAreColours=TRUE)
plot(HSV, valuesAreColours=TRUE)
Run the code above in your browser using DataLab