필터 지우기
필터 지우기

8 bit depth RGB image(gif)

조회 수: 3 (최근 30일)
Mahua Nandy(Pal)
Mahua Nandy(Pal) 2012년 3월 11일
is it possible to separate red ,green and blue channel of a 8 bit depth gif image with the following code?
redimg=im;
blueimg=im;
redimg(:,:,2:3)=0;
blueimg(:,:,1:2)=0;
greenimg=im;
greenimg(:,:,3)=0;
greenimg(:,:,1)=0;
if not then how can that be achieved?

채택된 답변

Image Analyst
Image Analyst 2012년 3월 11일
Copy and paste this example code:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.
fontSize = 20;
% Change the filename to your filename!
[gifImage cmap] = imread('C:\Users\yourname\Pictures\whatever.gif');
% Display indexed GIF image.
subplot(2,3, 1);
imshow(gifImage);
% Convert to true color RGB image.
rgbImage = ind2rgb(gifImage, cmap);
title('GIF Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
subplot(2,3, 2);
imshow(rgbImage);
title('After conversion to RGB', 'FontSize', fontSize);
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Display the three component color channels.
subplot(2,3, 4);
imshow(redChannel);
title('Red Channel', 'FontSize', fontSize);
subplot(2,3, 5);
imshow(greenChannel);
title('Green Channel', 'FontSize', fontSize);
subplot(2,3, 6);
imshow(blueChannel);
title('Blue Channel', 'FontSize', fontSize);
  댓글 수: 1
Mahua Nandy(Pal)
Mahua Nandy(Pal) 2012년 3월 12일
thank u for clearing my doubts.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by