I wonder is it possible to render Graphics
in Mathematica with bitdepth higher than "Byte"
which is the maximum bitdepth supported by the Windows XP operating system (it is so-called "True Color")? Tracing the rasterization with the option TraceInternal->True
shows that Graphics
is always rendered to a matrix of Integers
in the range from 0 to 255, then it may be converted to Reals
if requested but such conversion does not increase the bitdepth, of course: it changes only the internal representation of the Image
. For example, let us consider rendering of VertexColors
:
Cases[Trace[
Image[Graphics[
Polygon[{{-1, 0}, {1, 0}, {0, Sqrt[3]}},
VertexColors -> {Red, Green, Blue}], ImageSize -> 4], "Real"],
TraceInternal -> True],
x_List /; MatrixQ[Unevaluated@x, NumberQ], {1, Infinity}]
One can see matrixes of values between 0 and 255 in spite of requested "Real"
bitdepth. Let us compare the results of rendering with different requested bitdepths:
In[21]:= Image[
Graphics[Polygon[{{-1, 0}, {1, 0}, {0, Sqrt[3]}},
VertexColors -> {Red, Green, Blue}], ImageSize -> 4], "Real"] ===
Image[Image[
Graphics[
Polygon[{{-1, 0}, {1, 0}, {0, Sqrt[3]}},
VertexColors -> {Red, Green, Blue}], ImageSize -> 4], "Byte"],
"Real"]
Out[21]= True
It is obvious that the requested bitdepth does not change the real rendering bitdepth.
So the question is: is it possible to render Graphics
with bitdepth higher than Byte
?
Graphics
expression it is processed bySystem`ConvertersDump`ConvertGraphicToRasterDataPacket
which assembles anExportPacket
and sends it to the front end. The front end returns aSystem`ConvertersDump`Bitmap
expression, which contains compressed bitmap data with a bit depth of 8. TheExportPacket
has aColorSpace
option but nothing for bit depth. So I think unless there is a front end option to change the rendering bit depth (I can't see one myself), I suspect the answer is no. $\endgroup$