I want to convert 8 depth image in 24 depth.how can i do it???
13 views (last 30 days)
Show older comments
I have a 8 depth image and i want to convert this 8 depth image in 24 depth.how can i do it???
0 Comments
Answers (1)
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
Walter Roberson
on 24 Jan 2019
There are a few approaches:
- 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
- Use Computer Vision insertShape() to do the marking inside an array (which will always return an RGB array) and imwrite() that array; or
- 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.
See Also
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!