sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Is texture pixel color accessible from within ruby?

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 915 Views 3 Watching
    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

      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

        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
        • GaieusG Offline
          Gaieus
          last edited by

          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

            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

              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
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement