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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
For example, replacing all pinks with blacks. I was thinking of editing the actual dataframe (ie as.data.frame(im,wide="c")) and changing each instance of a pixel with the color I want. I know there are variations of this in the vignette, such as color.at <- and R(x) <- value, but I can't seem to see a specific one for changing a specific color.
The text was updated successfully, but these errors were encountered:
If you wish to replace all pixels with an exact colour value, try this:
##all pixels with colour c1 are given colour c2
replaceColour <- function(im,c1,c2)
{
#Split into channels
l <- imsplit(im,"c")
#Find pixels that match over all channels
sel <- map2_il(c1,l,function(a,b) b==a) %>% parall
#Replace, reconstruct
map2_il(c2,l,function(a,b) { b[sel]=a; b }) %>% imappend("c")
}
replaceColour(boats,color.at(boats,55,12),c(0,0,0)) %>% color.at(55,12)
If you need to select all pixels that are say, approximately red, have a look at
For example, replacing all pinks with blacks. I was thinking of editing the actual dataframe (ie as.data.frame(im,wide="c")) and changing each instance of a pixel with the color I want. I know there are variations of this in the vignette, such as color.at <- and R(x) <- value, but I can't seem to see a specific one for changing a specific color.
The text was updated successfully, but these errors were encountered: