[vtkusers] How to turn off dithering while rendering?

Wolfram H Volpi whv88240 at Bayou.UH.EDU
Sun Feb 18 09:52:10 EST 2001

Hello everybody.

I am rendering a small synthetic model and then saving the image.
Apparently dithering is corrupting the pixel-colors of the image.  
But I need to compare two images without dithering.
Is there a way to turn dithering off?

Thank you,

# vtk-tcl script.  
# ren1 is a vtkRenderer containing a synthetic model.
# Synthetic.vtk and Synthetic.ppm are dithered images of the synthetic

vtkRenderWindow renWin
	renWin AddRenderer ren1
	renWin SetSize 105 105	
	renWin Render
	renWin SetFileName "Synthetic.ppm"
	renWin SaveImageAsPPM

vtkPNMReader pReader
	pReader SetFileName "Synthetic.ppm"

vtkImageCast imgCast
	imgCast SetOutputScalarTypeToUnsignedShort
	imgCast SetInput [pReader GetOutput]

vtkStructuredPointsWriter sWriter
	sWriter SetInput [imgCast GetOutput]
	sWriter SetFileName "Synthetic.vtk"
	sWriter Update

More information about the vtkusers mailing list