开发者

Easy way to convert color range to another?

开发者 https://www.devze.com 2023-03-26 23:52 出处:网络
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?

I would like to convert the purple color in this image:

Easy way to convert color range to another?

开发者_JAVA百科 to blue such as:

Easy way to convert color range to another?

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

Easy way to convert color range to another?

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"]

Easy way to convert color range to another?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号