Setting Color Configuration for PNGSeriesReader in ParaViewWeb

Hello all,

When loading a stack of PNG images into client with paraviewweb using the PNGSeriesReader class, how is the ‘Color’ display option set? In the ParaView app, the ‘Color’ display option needs to be set to ‘PNGImage’ and the Representation to ’Surface’ to display properly.

Outside of the app, in my client python code, I was able to set the ‘Representation’ configuration option, but haven’t been able to figure out the color.

When I load a single PNG via the PNGSeriesReader class, the color appears to be set automatically, and displays fine. It’s when I load multiple as a stack, all I can see rendered is a big gray cube.

For reference this is how we’re loading the pngs and setting the representation:

cool_pngs = PNGSeriesReader(FileNames=‘./cool_pngs', ReadAsImageStack=True)
cool_pngs_display = Show(cool_pngs, GetRenderView())
cool_pngs_display.Representation = ‘Surface'

Best, GM

1 Like

Second this. Can’t seem to find what it might be in the API docs.

Something like simple.ColorBy(repProxy, (arrayLocation, arrayName))

arrayName: ‘PNGImage’
arrayLocation: ‘POINTS’

Awesome! Thanks so much Sebastien, that worked perfectly.

1 Like

BTW, using ParaView GUI with the Python trace is an invaluable tool to figure out how to do things in Python and therefore in ParaViewWeb.