Weaving based on 2D Pattern

I found a dynamo definition where you select a surface and generate 3D weave based on U/V grid.

Now, how do I approach to generate a 3D weave based on my 2D made pattern, see images attached?
Questions:
1 - how to get center points of white and black areas in my JPEGs?
2 - how to assign my seamless patterns onto surfaces in revit?