Pixelate image in exactly four grayscale colours

Hi All,
I have a grayscale image pixelated with image mapper and I want the image now in exactly four grayscale colours to be represented. Black dark-gray light-gray white. I think I know that remap numbers can do the trick - but not exactly sure how.

Any help highly appreciated - thnx in advance.
best.
©

you can set the image sampler to sample Brightness in order to get values in Domain [0, 1]

basic setup:

hands on:

obama_4_greys.gh (49.6 KB)

4 Likes

Great… thnx for this fast reply - I’ll try it out it out.
©

Could read it already in your first definition, that this is prob. what I need. Then the image proved it… many thnx.
©

It worked perfectly. And maybe one more quick thing: How can I select the square with a certain colour out of those?
thnx in advance
©

If you want the flexibility of dynamically assigning the file by filepath, which Image Sampler won’t let you do, you can always deconstruct the image mesh for its colours and reassemble.


trump_4_greys.gh (60.0 KB)

1 Like

Hi @inno
Does your GH definition work in Rhino V7?
Sorry haven’t tested it yet but wondering since I don’t have V8.
RM

Well clearly, if you open it up in v7 you’ll find out, won’t you? But it should. None of the newer components are being used there.

Try it yourself first :bangbang: :man_facepalming: :-1: