Deep3DFaceRecon_pytorch icon indicating copy to clipboard operation
Deep3DFaceRecon_pytorch copied to clipboard

How to extract the texture information and save it as an image

Open Koushik0901 opened this issue 3 years ago • 5 comments

Hi there, I am new to this stuff... So it would be nice if you could guide me on how to save the texture information of the mesh as png file

Koushik0901 avatar Oct 27 '21 13:10 Koushik0901

I have the same problem with you. The output of this model is .obj files, however the common 3D modeling software takes (obj, mtl, png) tuples as inputs, which contain texture information in png images. Although the .obj outputs have texture information in vertices information, the software seems to ignore the (R, G, B) values of these vertices.

elenacliu avatar Jan 08 '22 07:01 elenacliu

Yeah, I solved this by performing texture baking on blender to get the texture as png

Koushik0901 avatar Jan 08 '22 13:01 Koushik0901

@Koushik0901 I'm sorry, but I found that when Blender imports an obj file, it ignores vertex color, so can I get the texture image when I perform texture baking?

https://docs.blender.org/manual/en/latest/addons/import_export/scene_obj.html

图片

elenacliu avatar Jan 10 '22 07:01 elenacliu

@Koushik0901 I'm sorry, but I found that when Blender imports an obj file, it ignores vertex color, so can I get the texture image when I perform texture baking?

https://docs.blender.org/manual/en/latest/addons/import_export/scene_obj.html

图片

Yeah, You can get the texture(png file) by performing baking

Koushik0901 avatar Jan 10 '22 13:01 Koushik0901

I have the same problem with you. The output of this model is .obj files, however the common 3D modeling software takes (obj, mtl, png) tuples as inputs, which contain texture information in png images. Although the .obj outputs have texture information in vertices information, the software seems to ignore the (R, G, B) values of these vertices.

@Koushik0901

Ah, I find that although official implementation of import_obj addons does not support parsing .obj vertex color, you can

  1. add parsing codes yourself
  2. convert obj to ply via meshlab or sth similar

After converting obj to ply, you can generate texture map from vertex color by this script:

https://github.com/jiegec/blender-scripts

elenacliu avatar Jan 12 '22 03:01 elenacliu