Optimizing the texture coordinates of a mesh using meshlab. #313
Unanswered
jmespadero
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This script was created as side result of this question in stackOverflow about how to edit and save texture images in Meshlab, which can be summarized as:
Q: "Can I export an updated and much smaller texture image file from within MeshLab?"
A: "No, you can't. But..."
I have seen many projects addressing this problem, like this nice Pythagoras Bust model originally published by Geoffrey Marchal.
which uses this huge 8192x8192 texture:
where clearly only the bottom third of the image pixels are being used as texture, so it could be stored in just a 8192x2882 image without any loss.
This is not a specific problem of this model, but a quite common problem generated by some photogrammetry software, so there is lots of models that has texture images like that.
I have written some small script with pymeshlab that can do some work done (basically, compute the bounding box of the texture coordinates, crop the original texture image to contain just the referenced bounding box, and then remap the old texture coordinates into the new texture).
The good news are: Here is the code...
The bad news are: This script depends of a feature introducted in a recent comint f7c346c to fix issue #297 , so if you are reading this in june of 2023 you need to wait until next release of PyMeshlab (or download the current source code of pymeshlab from github).
Beta Was this translation helpful? Give feedback.
All reactions