• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Is texture pixel color accessible from within ruby?

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 3 Posters 915 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    a4chitect
    last edited by 31 Mar 2008, 20:14

    is there a known implementation of sampling color from a specific pixel of a texture? (not the material or its ID but the specific RGB) or are there any possible workarounds that come to your mind? thanks

    1 Reply Last reply Reply Quote 0
    • R Offline
      RickW
      last edited by 31 Mar 2008, 21:28

      Not unless you want to tie into ImageMagick (and require all users to install it to make the script work), or learn about how to extract pixel data manually from image files. 😞

      Sorry...

      RickW
      [www.smustard.com](http://www.smustard.com)

      1 Reply Last reply Reply Quote 0
      • G Offline
        Gaieus
        last edited by 1 Apr 2008, 08:04

        How about turning your model into "just" shaded (with colours) mode (instead of "with textures")? SU then gives an approximation of the average colour of that particular texture which you can then sample.

        Or have I completely misznderstood what you want?

        Gai...

        1 Reply Last reply Reply Quote 0
        • A Offline
          a4chitect
          last edited by 1 Apr 2008, 08:48

          Thanks 4 your replies guys, your tips are very useful, my problem is in not mentioning the purpose...

          the purpose was to have bitmap-analysis capabilities in sketchup, like displacement mapping and such. that would require to assign values to a grid by the specific color of the underlying texture. the possible workflow involves like rick suggested - using a 3rd party software to analyse the image and possibly convert it to an array (grid) of values (with customizable resolution). the method suggested by gaieus is interesting but not applicable since a subdivided texture maintains the same material 'parent' and therefore the bitmap approximation stays the same for each region, if i'm not mistaken.

          i'll probably look into scripting imagemagick to convert images into a organized data - and writing an importer into SU. any suggestions?

          1 Reply Last reply Reply Quote 0
          • R Offline
            RickW
            last edited by 1 Apr 2008, 20:28

            If a possible application would be contour maps generated from grayscale images, then it's been done. Check the SketchUp Pro user group boards, and look at some OLD ruby stuff. I can't remember the names of things, but TBD had one, and maybe Dider had something.

            RickW
            [www.smustard.com](http://www.smustard.com)

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              1/5
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement