how to convert 24bit of bmp image to 8 bit?

조회 수: 10 (최근 30일)
fk
fk 2016년 4월 28일
댓글: fk 2016년 4월 28일
i tried to make this program :
I = imread ('ctv.bmp');
kernel1 = [ -1 -1 -1 ; -1 8 -1 ; -1 -1 -1 ]
kernel2 = [ -1 -1 -1 ; -1 9 -1 ; -1 -1 -1 ]
kernel3 = [ 1/9 1/9 1/9; 1/9 1/9 1/9; 1/9 1/9 1/9 ]
hiPass = conv2(I, kernel1);
lowPass = conv2(I, kernel3);
bandPass = conv2(I, kernel2);
subplot(2,2,1), imshow(I);title('Gambar Asli');
subplot(2,2,2), imshow(uint8(hiPass));title('HiPass');
subplot(2,2,3), imshow(uint8(lowPass));title('LowPass');
subplot(2,2,4), imshow(uint8(bandPass));title('BandPass');
but it couldn't run. how to convert the 24bit to 8bit image?

채택된 답변

Stephen23
Stephen23 2016년 4월 28일
편집: Stephen23 2016년 4월 28일
  댓글 수: 1
fk
fk 2016년 4월 28일
thank you for your help :D btw, i've found another way to change it to 8 bit. just convert the image to .gif because .gif is only in 8 bit. FYI :D

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by