I would like to convert the purple color in this image:
开发者_JAVA百科 to blue such as:Is there an easy way to accomplish this? If not, is there an easy way to replicate the same effect?
Thanks
You could separate the image in R,G and B channels, and replace the red channel by zeroes, leaving only the G and B channels.
Example in Mathematica:
i = Import["http://tinyurl.com/3wqklof"];
ColorCombine@{ImageSubtract[#[[1]], #[[1]]], #[[2]], #[[3]]} &@ ColorSeparate@i
Edit
Or, If you need an "exact" blue image, separate in the "HSB" color space, replacing all non zero values of the H matrix by 2/3 (blue), leaving the S and B components untouched.
Example:
ColorCombine[{Image[2/3 ImageData@ImageAdd[#[[1]], #[[1]]]], #[[2]], #[[3]]} &@
ColorSeparate[i, "HSB"], "HSB"]
精彩评论