Closed sajis997 closed 4 years ago
We can remove an unnecessary channel.
I guess your image has R channel, G channel, B channel, and alpha channel. If you don't need alpha channel, use rm.alpha function as shown below.
im <- load.image("your_image.png") # im has 4 channels (R, G, B, alpha)
im2 <- rm.alpha(im) # im2 has 3 channels (R, G, B)
If you need some specific combination of channels, use imappend function and channels function.
Thanks for the hint! Should it not be documented somewhere ?
I am loaded a image outside the package with imager library for R. Then I am trying to use the grayscale function from the library and I am getting the following error:
Error in grayscale(im) : Image should have three colour channels The loaded image has the following information :
How to select and initiate image object in R with selective spectrum channels ?