sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🚨 Skimp | 25% Off until March 30 Buy Now

    Is texture pixel color accessible from within ruby?

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 1.0k 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

        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

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement