Skip to content
A collection of methods for dealing with colourspaces of images in R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
data
.Rbuildignore
.gitignore
DESCRIPTION
NAMESPACE
README.md
commit.command
data.R
documenting.R
image.Rproj

README.md

image

Change the colorspace of images.

png/jpeg recommended for file I/O

library(devtools)
install_github("AkselA/R-image")
library(image)

### get and convert included dataset
data(oslo.nat)
img4 <- as.image(oslo.nat)


### edit in HSV
img <- img_colorspace(img4, c_in="RGB", c_out="HSV")
img4 <- img
summary(img4)

img_display(img4)

# gently increase value (brightness)
img4[,,3] <- tanh(img4[,,3] * 1.5)
img4[,,3] <- img4[,,3] / max(img4[,,3])
summary(img4)

dev.new()
img_display(img4)


### edit in CIELAB
# intensify green/magenta
img5 <- img_colorspace(img, c_in="HSV", c_out="LAB")
img5[,,2] <- img5[,,2] * 2
summary(img5)

dev.new()
img_display(img5)

# intensify blue/yellow
img5 <- img_colorspace(img, c_in="HSV", c_out="LAB")
img5[,,3] <- img5[,,3] * 2
summary(img5)

dev.new()
img_display(img5)
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.