Mapping a color image as a texture onto a surface - not a question

After a long thread on texture mapping https://community.plotly.com/t/applying-full-color-image-texture-to-create-an-interactive-earth-globe/60166/5, and a partial solution (only for grayscale images), suggested along the last years,
here is the workaround for color images, with surprisingly good results https://chart-studio.plotly.com/~empet/16132.

The regular triangulation involved in meshing a surface looks like this :wink:

regular-tri

z_data is an array of shape (image_rows, image_columns). Hence we have an intensity value for each point in the meshgrid

np.meshgrid(np.linspace(a, b, image_columns), np.linspace(c,d, image_rows))

defined on the rectangular region mapped to the surface.
But the number of cells (faces) resulted from the regular triangulation is different from that in z_data.flatten(). That’s why I defined a rule that assigns to each cell a z_data value, like in the above image.

3 Likes

Hey @empet this image is amazing :star_struck::

Congratulations !!!

2 Likes

@Eduardo
Thank you! :slight_smile:
This one illustrates that the method of mapping preserves the details, too:
texture2

2 Likes

Can’t wait to see what applications people come up with for this. Definitely has some cartographic potential to help with the age old problem of flattening the earth (maybe variations between a full globe and a flat rectangle).

1 Like

@kmhurchla A google search reveals a lot of applications in computer vision, image segmentation and classification, and more. To present the results of such a study with Plotty, it’s important to have a method to map texture on surfaces.

1 Like