I am not really sure what you mean, but perhaps you want to convert the
image into RGB mode, and zero out the other two (GB) vectors?
Look up ?rgb and allied functions: may help.
Ranjan
On Thu, 6 Oct 2011 18:58:19 -0500 Lorenzo Isella
<lorenzo.isella at gmail.com> wrote:
> Dear All,
> I am not sure that R is exactly the right tool for doing what I have in
> mind, but a look at EBImage and rimage convinced me that this should be
> doable with R.
> I have a color image and I would like to do the following: convert the
> image into a grayscale image retaining only the red color (i.e. end up
> with a grayscale image where the only surviving color is red [or any
> color close enough to red]).
> Anybody has any idea about how to do that?
> Many thanks
>
> Lorenzo
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>