can MATLAB render 10-bit images in a 10-bit TV?
30 views (last 30 days)
Show older comments
Hello,
I want to generate grayscale gabor patches with different contrasts. Because I am interested in low contrasts, I want as much intensity levels as possible. Only 256 grayscale levels are definitely not enough.
I connected my laptop to my Samsung ue43au7025k TV. However, I can't see an improvement compared to the integrated display of my MSI Katana gf76. I know my TV supports 1 billion colors, while my MSI integrated display only supports 16.7 million.
Also, I have enabled hardware OpenGL.
I can't find many details regarding how MATLAB renders imagens, nor questions about this topic. I also found someone saying in 2016 that MATLAB cannot render 16-bit images. We are in 2024 now, so that should have changed. I am using MATLAB R2020b.
I am using double precision images. I use the imshow function that works well with double precision data. I also quantized the image so that it contains only 2^10 intensity levels in double precision. I also created a colormap with 2^10 levels and applied to the image. So I suppose the imshow function will implicitly convert the image to uint16 before rendering.
Can someone clarify if MATLAB renders 16-bit images, and if so, what is the procedure to ensure that?
0 Comments
Accepted Answer
Benjamin Kraus
on 16 Apr 2024
Edited: Benjamin Kraus
on 16 Apr 2024
As of R2024a, this MATLAB Answers post is still accurate: Does MATLAB support 10-bit or 12-bit monitors?
When you create an Image object (using imshow or image or imagesc), regardless of the input data format (RGB, RGBA, or grayscale and 8-bit or 16-bit), the internal implementation uses unsigned 8-bit numbers to represent red, green, blue, and alpha when transfering the data to the graphics card. You will not be able to display 10-bit grayscale images any more accurately than you can 8-bit grayscale images.
More Answers (1)
Hassaan
on 22 Jan 2024
- Data Type: Ensure that the image data is stored in a format that supports the desired bit depth. For 16-bit images, this would be uint16 for unsigned integers or int16 for signed integers.
- Display: MATLAB's imshow can display images of type uint16. However, most computer screens and standard image file formats are limited to 8 bits per channel. To truly benefit from 16-bit images, your display hardware must support this depth, and the image must be saved in a high-bit-depth format like TIFF.
- Graphics Card and Screen: Even if MATLAB supports higher bit depths, your graphics card and screen must also support and be configured to display them. The "1 billion colors" your TV supports likely refers to a 10-bit per channel color depth, which is more than standard 8-bit displays, but to utilize this, your entire graphics pipeline (including your operating system's settings, graphics card, and connection method, like HDMI 2.0 or DisplayPort) needs to be compatible.
- Colormap: If you are using a colormap, it should have enough entries to match the bit depth of your data, but note that MATLAB's figure windows are typically rendered in 8-bit color.
% Generate a 16-bit grayscale image
imageData = uint16(rand(512) * 2^16);
% Display the image using imshow
imshow(imageData);
% If you have a custom colormap with 2^10 levels
myColormap = gray(2^10); % Replace with your actual colormap
colormap(myColormap); % Apply the colormap
Keep in mind that even with the correct bit depth in MATLAB and a compatible display, whether you can visually discern the difference depends on the calibration of your monitor/TV, the ambient lighting conditions, and the dynamic range of the image content itself.
For precise image rendering and color management, you might need to delve into color profiles and possibly use specialized software or MATLAB toolboxes designed for image processing professionals.
To check if MATLAB's capabilities have advanced regarding 16-bit image rendering in the version you're using (post-R2020b), it's best to consult the latest MATLAB documentation or contact MathWorks support directly. They can provide the most accurate and up-to-date information.
-----------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
It's important to note that the advice and code are based on limited information and meant for educational purposes. Users should verify and adapt the code to their specific needs, ensuring compatibility and adherence to ethical standards.
Professional Interests
- Technical Services and Consulting
- Embedded Systems | Firmware Developement | Simulations
- Electrical and Electronics Engineering
Feel free to contact me.
2 Comments
Ziyuan Lau
on 16 Apr 2024
Hey bro, did you find a solution to this problem? Although it's not stated in the official documentation, it seems that using imshow directly on a 0-1 double precision grayscale map only shows it as an 8-bit depth. im also finding the way to show a 10 bits grayscale luminance pattern on screen by matlab, but not much releveant information
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!