Change the intensity of blue in a .jpg

Hello, how do I change the blue intensity of a .jpg so that the new image is combination of rg and the new b. Thanks.

 Accepted Answer

% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Now change the blue channel in whatever way you want.
blueChannel = whatever.........
% Then recombine into the new color image.
rgbImage = cat(3, redChannel, greenChannel, blueChannel);

6 Comments

I have tried the rgbIamge function, but an error keeps on popping up.
undefined function 'rgbImage' for input arguments of type 'char'.
Could you show me what I would have to do before using this function. Thanks
rgbImage is not a function. In the above, Image Analyst has used rgbImage as the example name where the name of your image array would go.
Billy
Billy on 20 Nov 2012
Edited: Billy on 20 Nov 2012
Oh the IM is the same as this rgbImage. Thank you very much to the both of you, sorry for being redundant. One last question. How do I display this new image, I am not sure how I piece together your answer and the one I received here. Thanks again.
blueChannel = uint8(single(blueChannel) + 255*BX/100);
Then recombine and show the final image:
imshow(rgbImage);
Thank You VERY Much. That saved a lot of headache.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!