Author Topic: Get rgb values per pixel  (Read 1805 times)

Is it possible to get RGB values per pixel in the pixel processor node? I'm trying to average the RGB values in an image and display it as every pixel, but I don't know how to get the RGB values per pixel. :/

I know this isn't how you want to do it but, would you not get the same result from blurring the image a whole bunch of times?

you can get it (get float 2 ($pos)--> sample color) , but it will be useless, as you won't be able to compare it to other pixels.
What you can do is passing your input in 16 bits float, plug it in a transform 2 d node, change the mipmap mode to manual, and set the size to the same one than your graph
Last Edit: June 26, 2017, 11:04:32 am

Follwing my post; like this~ It's the same as the average filter in photoshop.
Last Edit: June 20, 2017, 02:11:16 pm

By doing this you are getting really close, but it's not as accurate as the method described above.

Are you sure it's not accurate? It give the exact result from photoshop filter but then I dont know if that's accurate for sure. Ahh I see you can also get the same effect by just scaling the image down to 1x1 pixels then back up again if needed.

Thanks for both of your methods, I'll try both and get back to you. I'll post results when i get them working.

Are you sure it's not accurate? It give the exact result from photoshop filter but then I dont know if that's accurate for sure. Ahh I see you can also get the same effect by just scaling the image down to 1x1 pixels then back up again if needed.

It's theoretically less accurate. In practice, it should not make any measurable difference in most cases. What matters most though is that Vincent's way of doing it should be much faster.
Last Edit: June 21, 2017, 10:51:29 am

I was puzzled by Vincent's description for a while until I looked at the transform for myself. There's a bit of a typo. He means change the "MIPmap mode" property of Transform2d to Manual, not "Bitmap mode". And then set the "Mipmap Level" to the size of your graph. (so, a 1024x1024 [2^10] graph would use a level of 10)

I was puzzled by Vincent's description for a while until I looked at the transform for myself. There's a bit of a typo. He means change the "MIPmap mode" property of Transform2d to Manual, not "Bitmap mode". And then set the "Mipmap Level" to the size of your graph. (so, a 1024x1024 [2^10] graph would use a level of 10)
Ahh now I see! yea this way is obviously better than mine, I wasn't aware that this could be done. :O

I was puzzled by Vincent's description for a while until I looked at the transform for myself. There's a bit of a typo. He means change the "MIPmap mode" property of Transform2d to Manual, not "Bitmap mode". And then set the "Mipmap Level" to the size of your graph. (so, a 1024x1024 [2^10] graph would use a level of 10)
Thanks!
I fixed it