can MATLAB render 10-bit images in a 10-bit TV?

27 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Benjamin Kraus
Benjamin Kraus il 16 Apr 2024
Modificato: Benjamin Kraus il 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.
  1 Commento
André
André il 16 Apr 2024
Modificato: André il 16 Apr 2024
Thanks for the answer. So better you clarify those posts here in the forum that claim MATLAB supports 16-bit images given you enable hardware OpenGL rendering (not sure where I read them, but I know they exist).

Accedi per commentare.

Più risposte (1)

Hassaan
Hassaan il 22 Gen 2024
  1. 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.
  2. 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.
  3. 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.
  4. 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 Commenti
André
André il 22 Gen 2024
1: Regarding the data type, I am using "double", which is also compatible with imshow. Because "double" has 64 bits, imshow should render the image with the maximum bit depth possible, in this case 16-bits. Are you saying that "double" will render only as 8-bits? Do I really need to explicitly convert it to uint16 before calling imshow?
2: My TV is 10-bits, so it should support more levels than 8-bits, even if it doesn't support 16-bits, but should be better than 8-bits.
3: I'm not sure if I am using HDMI 2.0, I will check later. Appart from that, I am using a 2 year old high performance gaming MSI laptop. I am sure the graphics pipeline is compatible. I am using Windows 10, and I don't think I have to enable anything to activate more than 8-bit depths.
4: Yes, as I said before, I am using a 10-bit colormap. Everything is done accordingly.
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.
Well, I was expecting someone would answer this, as the MATLAB documentation for imshow documentation does not clarify about this.
Ziyuan Lau
Ziyuan Lau il 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

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by