Limit Color Count - Grasshopper2024-03-29T09:52:25Zhttps://www.grasshopper3d.com/forum/topics/limit-color-count?commentId=2985220%3AComment%3A264038&feed=yes&xn_auth=nobaHahahahahahahaha! tag:www.grasshopper3d.com,2015-06-12:2985220:Comment:13082252015-06-12T19:04:26.580ZBrian Muthaliffhttps://www.grasshopper3d.com/profile/BrianMuthaliff
<p>baHahahahahahahaha! </p>
<p>baHahahahahahahaha! </p> In case anybody is interested…tag:www.grasshopper3d.com,2013-07-25:2985220:Comment:8918472013-07-25T21:03:48.400ZArtyom Maximhttps://www.grasshopper3d.com/profile/ArtyomMaxim
<p>In case anybody is interested, here's an example of how to dither object colors based on attractors. (Grasshopper 0.9.0056)</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2768834952?profile=original" target="_self"><img width="500" src="http://storage.ning.com/topology/rest/1.0/file/get/2768834952?profile=RESIZE_1024x1024" width="500" class="align-full"/></a></p>
<p>In case anybody is interested, here's an example of how to dither object colors based on attractors. (Grasshopper 0.9.0056)</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2768834952?profile=original" target="_self"><img width="500" src="http://storage.ning.com/topology/rest/1.0/file/get/2768834952?profile=RESIZE_1024x1024" width="500" class="align-full"/></a></p> u could limit the colors by p…tag:www.grasshopper3d.com,2011-06-05:2985220:Comment:2659182011-06-05T07:17:21.332Zekaggrat singh kalsihttps://www.grasshopper3d.com/profile/ekaggratsinghkalsi
u could limit the colors by posterizing them......
u could limit the colors by posterizing them...... Well your colours will be thr…tag:www.grasshopper3d.com,2011-06-04:2985220:Comment:2640712011-06-04T11:32:03.196ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>Well your colours will be three-dimensional (R, G <em>and</em> B) so you'll need 3D voronoi diagrams.</p>
<p> </p>
<p>I'm typing on this now but I think the job is far too big. I couldn't find a decent quantisizer in the .NET framework.</p>
<p> </p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p>
<p>Well your colours will be three-dimensional (R, G <em>and</em> B) so you'll need 3D voronoi diagrams.</p>
<p> </p>
<p>I'm typing on this now but I think the job is far too big. I couldn't find a decent quantisizer in the .NET framework.</p>
<p> </p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p> Exactly.
That link you sent w…tag:www.grasshopper3d.com,2011-06-04:2985220:Comment:2639572011-06-04T10:56:52.879ZOgnek Kcirokshttps://www.grasshopper3d.com/profile/OgnekKciroks
<p>Exactly.</p>
<p>That link you sent was cool. There was a diagram that illustrates what I was trying to do changing RGB to XYZ, finding multiple averages, closest points, and converting to RGB again. I'll try making Voronoi regions as shown in the illustration and see how that works. </p>
<p>Cheers David,</p>
<p>Ognek</p>
<p> </p>
<p> …</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2768662177?profile=original" target="_self"><img class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2768662177?profile=RESIZE_480x480" width="400"></img></a></p>
<p>Exactly.</p>
<p>That link you sent was cool. There was a diagram that illustrates what I was trying to do changing RGB to XYZ, finding multiple averages, closest points, and converting to RGB again. I'll try making Voronoi regions as shown in the illustration and see how that works. </p>
<p>Cheers David,</p>
<p>Ognek</p>
<p> </p>
<p> </p>
<p><a target="_self" href="http://storage.ning.com/topology/rest/1.0/file/get/2768662177?profile=original"><img class="align-full" width="400" src="http://storage.ning.com/topology/rest/1.0/file/get/2768662177?profile=RESIZE_480x480"/></a></p> Ah, I see. So you have N colo…tag:www.grasshopper3d.com,2011-06-04:2985220:Comment:2640382011-06-04T10:11:39.225ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>Ah, I see. So you have N colours and are looking to generate a set of X different colours (where X is smaller than N) that approximate N as best as possible? This is called Color Quantization (<a href="http://en.wikipedia.org/wiki/Color_quantization#Algorithms">http://en.wikipedia.org/wiki/Color_quantization#Algorithms</a>) and it's not particularly easy.</p>
<p> </p>
<p>I'll have a dig around GDI bitmap color palette functions, see if there's anything already…</p>
<p>Ah, I see. So you have N colours and are looking to generate a set of X different colours (where X is smaller than N) that approximate N as best as possible? This is called Color Quantization (<a href="http://en.wikipedia.org/wiki/Color_quantization#Algorithms">http://en.wikipedia.org/wiki/Color_quantization#Algorithms</a>) and it's not particularly easy.</p>
<p> </p>
<p>I'll have a dig around GDI bitmap color palette functions, see if there's anything already available.</p>
<p> </p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p> David,
Thank you very much. …tag:www.grasshopper3d.com,2011-06-04:2985220:Comment:2641402011-06-04T09:26:53.801ZOgnek Kcirokshttps://www.grasshopper3d.com/profile/OgnekKciroks
<p>David,</p>
<p>Thank you very much. </p>
<p>For the color thing: I'd like to limit the colors with a user input. Let's say "no more than 10 colors" means it would take all the colors from Image Sampler, and interpolate what those 10 would be based on how similar those colors are. Thats why I thought I could find multiple averages in XYZ, and use closest point tool, then convert it back to RGB. </p>
<p>Does this make sense?</p>
<p>Ognek</p>
<p>David,</p>
<p>Thank you very much. </p>
<p>For the color thing: I'd like to limit the colors with a user input. Let's say "no more than 10 colors" means it would take all the colors from Image Sampler, and interpolate what those 10 would be based on how similar those colors are. Thats why I thought I could find multiple averages in XYZ, and use closest point tool, then convert it back to RGB. </p>
<p>Does this make sense?</p>
<p>Ognek</p> Hi Ognek,
the number of col…tag:www.grasshopper3d.com,2011-06-03:2985220:Comment:2637212011-06-03T21:51:51.985ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>Hi Ognek,</p>
<p> </p>
<p>the number of colours is limited already (there's only 16777216 different colours). You're clearly looking to project this RGB colour space onto a smaller set. But how do you define this set?</p>
<p> </p>
<p>To compute multiple averages, you need to add all values together, then divide by the number of values. You should be able to get there with Mass Addition, List Length and Divide.</p>
<p> </p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad,…</p>
<p>Hi Ognek,</p>
<p> </p>
<p>the number of colours is limited already (there's only 16777216 different colours). You're clearly looking to project this RGB colour space onto a smaller set. But how do you define this set?</p>
<p> </p>
<p>To compute multiple averages, you need to add all values together, then divide by the number of values. You should be able to get there with Mass Addition, List Length and Divide.</p>
<p> </p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p>