Look into the cinemaIO directory of ParaView. We move back and forth
between paraview, numpy and PIL often there.
image = self.view.CaptureWindow(1)
ext = image.GetExtent()
width = ext - ext + 1
height = ext - ext + 1
imagescalars = image.GetPointData().GetScalars()
idata = numpy_support.vtk_to_numpy(imagescalars)
imageslice = idata.reshape(height, width, 3)
imageslice = numpy.flipud(imageslice)
pimg = PIL.Image.fromarray(imageslice)
David E DeMarle
21 Corporate Drive
Clifton Park, NY 12065-8662
On Wed, Oct 12, 2016 at 1:42 PM, Albina, Frank <frank.albina@sauber-
> A simple question: my incentive is to manipulate images using PIL in a
> pvbatch script. At the time being, I am writing the images to file in PNG
> format and reading the file again from disc using PIL. I have found out
> that the underlying image writing is performed by the vtkPNGWriter class
> and that this class allows to write to memory (vtkPNGWriter.SetWriteToMemory).
> Hence my question: Is it possible to “write” a PNG file to memory so that I
> can process it further using PIL? If so, how shall I proceed?
> Thank you very much in advance.
> Powered by www.kitware.com
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> Please keep messages on-topic and check the ParaView Wiki at:
> Search the list archives at: http://markmail.org/search/?q=ParaView
> Follow this link to subscribe/unsubscribe:
Powered by www.kitware.com
Visit other Kitware open-source projects at
Please keep messages on-topic and check the ParaView Wiki at:
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe: