I want to convert 8 depth image in 24 depth.how can i do it???

13 views (last 30 days)
I have a 8 depth image and i want to convert this 8 depth image in 24 depth.how can i do it???

Answers (1)

Walter Roberson
Walter Roberson on 23 Jan 2019
Usually when 24 bit images are talked about, what they are referring to is the total of 24 bits because of 8 bits for each of 3 color components.
If you already have a uint8() RGB image, it is probably already "24 bit".
If you have a uint8 grayscale image, then YourImage(:,:,[1 1 1]) replicates the grayscale layer into RGB making it 24 bit.
True 24 bits per component RGB images (72 bits total) are rarely used outside of photorealistic ray-tracing supercomputer clusters. Even then 16 bits per component RGB (48 bits total) would be much more likely. There is no hardware support for 24 bits per component in any commercial system; see https://en.wikipedia.org/wiki/Color_depth#Deep_color_(30/36/48-bit)
  2 Comments
thara naiz
thara naiz on 24 Jan 2019
Thank you.I have a 8 depth gray iimage.i marked red color detected points in this image and i cannot save thisnmarked image with those red points.when i use imwrite it save as 8 depth gray image.not shown that red marks.what can i do for it???
Walter Roberson
Walter Roberson on 24 Jan 2019
There are a few approaches:
  1. if you use one of the imroi() based routines to do the marking, you can use roi2mask() to find the correspoding array locations, and use those to set values inside an array, and imwrite() the array; or
  2. Use Computer Vision insertShape() to do the marking inside an array (which will always return an RGB array) and imwrite() that array; or
  3. Do the marking on-screen and capture the screen using getframe() or saveas() or print(). If you do this then the output will probably not have exactly the same size and resolution as the original.

Sign in to comment.

Categories

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

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!