<div dir="ltr">Look into the cinemaIO directory of ParaView. We move back and forth between paraview, numpy and PIL often there.<div><br></div><div>For example:</div><div>image = self.view.CaptureWindow(1)<br></div><div>ext = image.GetExtent()</div><div>width = ext[1] - ext[0] + 1</div><div>height = ext[3] - ext[2] + 1</div><div>imagescalars = image.GetPointData().<wbr>GetScalars()</div><div>idata = numpy_support.vtk_to_numpy(<wbr>imagescalars)</div><div>image.UnRegister(None)</div><div>imageslice = idata.reshape(height, width, 3)<br></div><div><div>imageslice = numpy.flipud(imageslice)</div><div>pimg = PIL.Image.fromarray(imageslice)</div></div><div class="gmail_extra"><div><div class="gmail-m_6844414496896149321gmail_signature"><br></div><div class="gmail-m_6844414496896149321gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: <a href="tel:518-881-4909" value="+15188814909" target="_blank">518-881-4909</a></div></div>
<br><div class="gmail_quote">On Wed, Oct 12, 2016 at 1:42 PM, Albina, Frank <span dir="ltr"><<a href="mailto:frank.albina@sauber-motorsport.com" target="_blank">frank.albina@sauber-<wbr>motorsport.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="DE-CH"><div class="gmail-m_6844414496896149321m_-4448648853816716371WordSection1"><p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:arial,sans-serif;color:rgb(31,73,125)">All,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:arial,sans-serif;color:rgb(31,73,125)">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<wbr>). 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?<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:arial,sans-serif;color:rgb(31,73,125)">Thank you very much in advance.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:arial,sans-serif;color:rgb(31,73,125)">Cheers,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:arial,sans-serif;color:rgb(31,73,125)">Frank.</span><span lang="EN-US" style="font-size:8pt;font-family:arial,sans-serif;color:green"><u></u><u></u></span></p></div></div><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaV<wbr>iew</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/paraview</a><br>
<br></blockquote></div><br></div></div>