Grasshopper

algorithmic modeling for Rhino

Hi all,

The output of ImageSampler whit the channel RGBAcolors is RGB values, but i need three values get converted in to one number. How can i return to the three values again? 

regards,


Erick

Views: 2950

Replies to This Discussion

Hi Erick,

you can't. When you feed a colour into a number parameter, the colour RGB channels are treated as a vector XYZ components. Then the length of the vector becomes the number. There are a lot of colours that end up having the same vector-length, in other words, this conversion is not lossless.

Why are you converting colours to individual numbers? What sort of information do you want to encode in these individual numbers?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David thanks for the reply, I converted to individual numbers because I want to make a transition between images, similar to scaled boxes, but in this case I have to work with colors. how can i make that transition?

You need to convert your colours to numbers, but in a way that is meaningful within your algorithm. You can certainly blend between two colours (there's a [Blend Colours] component exactly for that), but you'll need to tell us what characteristic you wish to blend/interpolate. Is it something one-dimensional such as brightness or hue? or are you looking to blend full colours, which are 4-dimensional entities (RGBA)?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I tried to guide with the discussion about attractor colour, and your weighted blending  is what I wanted, but try to apply to the definition and didn't get good results

I wanna see that blendingin every "pixel"(planar surface), and also animate the blend with one slider. Any suggestion. thanks

Erick

It's an interesting problem because you need to interpolate between more than 2 values with a single slider. I solved it in this case by converting colours to points, then fitting a curve through those points. Curves can be evaluated anywhere along their length so that solves the problem in one way. It's difficult to control the exact sampling speed between images though.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

Nice approach to the problem. The curve stuff is very inspiring :)

I added an interpolation component with 4 interpolation algorithms (block, linear, cubic, catmull spline). Works on integers, numbers, points, vectors, intervals and colours.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

awsome!

Thanks David, great stuff! I made a modification for work with multiple mesh (like pixels) and seems a better blend, except in the middle image, it is possible to differentiate, but is overlaid, but when works with a single mesh, not obtained a good blend. any idea to fix this?

Impressive! David, take that back, 'cause it works great, thanks again!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service