- Home /
Can Unity generate 16 bit gray level texture in script?
Hi all,
This may seem a strange question. I am a graduate student and I am using Unity to develop a data visualization tool for my research. What I am trying to do is to have Unity read in an image (16 bit gray level image, so 0-65535), and reconstruct the image in the 3D volume (using mesh). I have a working framework with 8 bit gray level image now, but the result isn't as good as I had hoped. I am wondering if Unity can generate 16 bit gray levels in script?
I am extremely new to Unity (and frankly, software development), so apologize if this question is totally dumb.
Best
I'm not sure to understand your problem.
You want to generate meshes' vertices from texture's colors, right? why does it have to be gray if you need more bit?
And the reason why you only have 8bit is because color (in unity) are coded on 24bit (or 32bit if you have alpha). since Gray mean Red value = Green value = Blue value you can get only 8bit data from Gray.
All things considered, different color formats are simply utilizing data in different ways. Conceptually (but not exactly as straightforward as it sounds), an RGBA image could have its data converted into a 16-bit gray image with twice as many pixels by concatenating the Red/Green and Blue/Alpha channels of the image.
The image would potentially need to be manually read in (i.e. not simply in the form of an image) in order to make use of it. However, I can't speak from experience as far as this goes. If there are other or better options, I'm simply not aware of them (yet).
The reason I am using gray level is that the data I am trying to visualize is gray...(a 16 bit deep .tiff image). Such an image format is very common in scientific imaging (e.g. astronomy or microscopy), it offers a more finely-quantized data.
So I am guessing I can't use more than 256 gray levels?
Hmm... I'm afraid I can't personally offer any further advice on this, but here's some food for thought on the topic.
Your answer
![](https://koobas.hobune.stream/wayback/20220613200254im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Does micropoly / tinypoly texture mapping have disadvantages? 1 Answer
Textures do not appear on mesh correctly? 0 Answers
how to texture two instances of a character 1 Answer
Is it possible to set smoothness and metallic of a mesh per-vertex instead of the whole material? 0 Answers
No culling in a transparent texture 0 Answers