how to convert the rgb componet of image in 8bit - binary value for matlab?

2 views (last 30 days)
i want to convert the r,g and b componet of image in 8bit-binary format ...

Answers (1)

Image Analyst
Image Analyst on 31 Mar 2014
What format are they in now? Normally most RGB images are in 8 bits per channel (24 bits total) unsigned 8 bit ("uint8"). What are yours? I'm not sure what you want to convert into what. What are you starting with (a 3D RGB image, or 3 separate gray scale color channels), and what do you want to end up with (a 3D RGB image, or 3 separate gray scale color channels)?
  1 Comment
sandy sorathiya
sandy sorathiya on 1 Apr 2014
i want to hide the text in RGB image so that 1]i take one RGB image. 2]seprate each componet of RGB in r,g and b. 3]now i want to convert each componet into 8unit binary but each componet take the value unit8 becuse my original image size is 50*50 so HOW CAN I CONVERT ALL COMPONET IN ONALY 50*50 8 UNIT?
HERE IS MY CODE clear all; close all; clc; warning('off', 'Images:initSize:adjustingMag') RGB=imread('Untitled.png'); figure(); imshow(RGB); %-------- R=RGB(:,:,1); G=RGB(:,:,2); B=RGB(:,:,3);
disp('r componet'); R=RGB
disp('G componet'); G=RGB
disp('B componet'); B=RGB
R(:,:,2)=0; R(:,:,3)=0;
B(:,:,1)=0; B(:,:,2)=0;
G(:,:,1)=0; G(:,:,3)=0;
figure(2); imshow®; figure(3); imshow(G); figure(4); imshow(B);

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!