Raw data from image

This question might be confusing and not make sense. Is there any way in the Ruby API to read raw data from an image and make a texture from that?

have you looked at the API for material?

 model = Sketchup.active_model
 materials = model.materials
 material = materials.add('Joe')
 material.texture = "C:/Materials/Carpet.jpg"

the path can be to any supported raster image file…


The API doesn’t have anything to manipulate raw image data. If you do have raw image data from some source you’d have to write it out to a file and use that to create a new Texture object like John demonstrated with material.texture=.

Ok. Thank you for the response.