Grasshopper

algorithmic modeling for Rhino

1. I want to know why change colors to numbers produce this result. Does each color has a specific value? Into what interval? Do these values have a function order?

2. I need to specify a number for each color. The problem is that I think there are 255^3 colors, approximately 16,000,000, so consumes a lot of runtime.

I need this to find the colors that are in a domain of color, without using other plugins. Something like this but with colors.

I made a rasterization algorithm that extracts curves that works well on images in black and white. But I want to go further, and make a rasterization with color, ie take each branch of colors wich are in a domain to change each list by an intermediate color.

If I had a number for each color, I think it could work with numbers and then change to its corresponding color. But these numbers should follow a gradual order...

Any clarification or suggestions? Apart from that there are softwares that do this as Illustrator, I would like to clarify these doubts about the colors in gh.

Thanks!

Views: 2847

Replies to This Discussion

Someone help?

Bit unexpected, I thought when colours were converted into numbers you'd get greyscale values (0.0 to 1.0). That's clearly not happening, so either I misremembered how it's supposed to work or there's a bug. Colours to Integers are different btw. colours are often internally represented as a single integer. The 4 byte channels (red, green, blue and alpha) are appended sequentially resulting a single 32-bit integer (4 channels * 8 bytes per channel = 32 bits).

What seems to be happening with colours->numbers is that it's the end-result of the conversion colour->vector->number. When converting colours to vectors, red becomes x, green becomes y and blue becomes z (alpha is lost). The conversion is such that all colour channels (0 to 255) are mapped onto the (-1 to +1) domain. Converting vectors to numbers just gives you the length.

As a result this is not a useful conversion, as many different colours map onto the same numbers.

Ok, thanks for the clarification.

So if I wanted to convert each color in a number, for example 0,0,0 = 0; 255,5,0 = 260 and 255,255,255 = 16581375. What order should I follow? First x, then y and z then, right? But how compute this? Since this is text (really color format), how I can interpolate the data to be a list of 0,0,0 - 1,0,0 - 2,0,0... 255,0,0 - 255,1,0 - 255,2,0... 255,255,0 - 255,255,1 - 255,255,2... ??

Just plugging a colour into an integer parameter will make this conversion.

Ohh, so easy!

Thank you so much David :D

David, este es el resultado que quería o un error? Digo, ¿por qué el nivel máximo de saturación está en el punto 0.5 en Z? ¿No sería más apropiado que este representa el espacio HSV? Yo creo que sería de color más tonificada, como lo es ahora sólo hay colores más blancos.

Nerozumiem dobre po Spanielsky, preto som ignoroval toto hlasenie. Je to mozne ze farebny priestor je pomýlený. 

Ouh, sorry, it was the automatic translator of chrome :/

Well, if it is bug, at least you already know.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service