I want to export 3D graphics (a graphics complex) with no Antialiasing. The following code works perfectly on Mac.
img = Rasterize[
Style[Graphics3D[{Antialiasing ->
False, {{Glow[Green], Sphere[{0, 0, 1.5}, 0.35]}, {Glow[Yellow],
Sphere[{0, 0, 1}, 0.5]}, {Glow[Red],
Sphere[{0, 0, 0.5}, 0.35]}}}, PlotRangePadding -> None,
Boxed -> False, Lighting -> None, ImageSize -> 100],
RenderingOptions -> {"3DRenderingEngine" -> "OpenGL",
"HardwareAntialiasingQuality" -> 0}], RasterSize -> 100,
ImageResolution -> 100]
Flatten[ImageData[img], 1] // Tally
The tally of the image colors is as expected only 4 colors: Red, Green, Yellow, and White. However, on a Windows 10 machine, using a similar code, I can not enforce the no-AntiAliasing. The tally of the colors in the image gives more than the expected four colors.
img = Rasterize[
Style[Graphics3D[{Antialiasing ->
False, {{Glow[Green], Sphere[{0, 0, 1.5}, 0.35]}, {Glow[Yellow],
Sphere[{0, 0, 1}, 0.5]}, {Glow[Red],
Sphere[{0, 0, 0.5}, 0.35]}}}, PlotRangePadding -> None,
Boxed -> False, Lighting -> None, ImageSize -> 100],
RenderingOptions -> {"3DRenderingEngine" -> "DirectX",
"HardwareAntialiasingQuality" -> 0}], RasterSize -> 100,
ImageResolution -> 100]
Flatten[ImageData[img], 1] // Tally
Any idea how to ensure that the code also works in Windows? Thanks
Elie