[vtkusers] gamma-correction on output image (vtkImageWriter)?

Chen, Elvis anisotropic7 at yahoo.ca
Mon May 20 13:00:56 EDT 2002


Greetings,

I'm in the process of making some animation movies for
my visualization project.  The approach I take is to
generate a bitmap file using for each frame I render
(in Python2.2/VTK4):

    global currentFrame
    wif = vtkWindowToImageFilter()
    wif.SetInput( pane.GetRenderWindow() )
    w = vtkBMPWriter()
    w.SetInput( wif.GetOutput() )
    w.SetFileName( 'animation' + str( currentFrame ) +
'.bmp' )
    w.Write()
    currentFrame += 1

this will generate a series of .bmp file in 24bit
color, which is what I need.

the problem is, I have to use program such as xv to
manually edit each of these .bmp file to perform gamma
correction.  All these images are too dark; I have to
bump up the gamma value from 1 to 1.7 (in xv) for each
of the RGB channel in order to get back the same
brightness as what I actually see on the vtk renderer.

My question is, can I perform gamma-correction in vtk
before the bitmap files are generated?  My animation
requires 200+ bitmap files, and I would like to avoid
editing each of these files manually.

thx in advance,

Elvis

______________________________________________________________________ 
Find, Connect, Date! http://personals.yahoo.ca



More information about the vtkusers mailing list