Unique3D icon indicating copy to clipboard operation
Unique3D copied to clipboard

Extract texture/colors as png/jpeg once model is saved

Open mattia-z opened this issue 1 year ago • 2 comments

Sorry for the question, but I'm a total novice on handling glb file. Once the model has saved the glb file, I'd like to extract the texture/colors from it into a png/jpeg file.

For glb files produced by other models I'm able to do this with the following code

from pygltflib import GLTF2, ImageFormat
from PIL import Image as PILImage
import io

# Load the GLB file
filename = "/content/unique3d.glb"
gltf = GLTF2().load(filename)

# Convert the images to PNG format
gltf.convert_images(ImageFormat.FILE)
gltf.images[0].uri

BUT for the glb file produced by Unique3d this code does not work. Is anyone able to guide me on doing this?

Thanks in advance!

mattia-z avatar Aug 11 '24 10:08 mattia-z

@mattia-z - were you able to solve this. I am also facing same issue

gurudt12 avatar Sep 04 '24 09:09 gurudt12

@mattia-z - were you able to solve this. I am also facing same issue

sorry for the late reply, but still no. For my understanding, colors are saved inside the vertexes that's why the code i had does not work. But with my little knowledge of this field i wasn't able to figure out which is the right solution

mattia-z avatar Sep 16 '24 06:09 mattia-z