Increasing bit depth of an image from 4 bit to 8 bit

조회 수: 4 (최근 30일)
Muhammad Hamid
Muhammad Hamid 2011년 9월 22일
Hi I have an image of skull in gray format and i first decreased its bit depth from 8 bit to 4 bit,which was easy but now the problem is with recovering the original image from this transformed 4 bit image to 8 bit.....hope u got my point... waiting for the reply..
  댓글 수: 2
Jan
Jan 2011년 9월 22일
Please post how you converted it to 2 bits. As far as I can see, some color information is lost by this procedure. Then you cannot recover the original image.
Muhammad Hamid
Muhammad Hamid 2011년 9월 24일
i have used "bitand" fuction for this reason
Image=bitand('originalimage',240)
now it is reduced to 4 bit

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

답변 (1개)

Walter Roberson
Walter Roberson 2011년 9월 22일
You cannot recover the full depth of an image if you reduced the image to below ceil(log2(N)) bits per pixel where N is the number of unique colors (or shades) in the image ( N = length(unique(IMG(:))) )
  댓글 수: 8
Muhammad Hamid
Muhammad Hamid 2011년 9월 25일
@Image Analyst: hahaha yes there were 2 images, sorry for my english..
Image Analyst
Image Analyst 2011년 9월 25일
Why would it work on one and not the other? Just divide by something (16) to get your image into the range 0-15 (a 4 bit range), and then multiply that by 16 to get it into the range 0-255 (an 8 bit range). Explain why you're unable to divide and multiply by 16 on *one* of the images. What error message do you get?

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

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by