Export Planar Mesh to Tiff

Dear Community

How would it be possible to write a python script in grasshopper to export a tiff file from a planar mesh and a polyline as image boundary (w x h)? the boundary could have a white fill and the image resolution can be 600 dpi
i tried using plugins like shapedivers squid, Bitmap+ or Graphic+

Here is the intended case. Thank you


Planar Mesh to Bitmap.3dm (125.7 KB)