Image pixel symmetry

I am playing around with images and wanted to set an series of points, and eventually other parameters using the image pixel values. The issue I’m running into is that the sampling is offset, not symmetrical. How can you adjust for this. Attached an image of a z coordinate set by brightness from a sampled gradient that is symmetrical.

If you think about it, the values are symmetrical about .5 rather than 0. Could you just subtract .5 from the value and then it would be symmetrical around 0 like you are expecting? I guess I am assuming the range is 0 to 1 based on the graph image provided.

Hi Sean, Thanks for the answer. Sorry I got caught up at work.

I think I’m looking at this the wrong way. My confusion comes from where the sample is being taken on the image and why the resulting values are not symmetrical. I’ve attached a graph for you to adjust or comment.

Thanks for your time,

Marlacrc_circle_gradient

image sample inquiry 2.dyn (16.6 KB)

I am not sure why it is starting at 0,0 as you have described, but I think that if you remove the index 0 of each sub-list then it will give you the results you are after.

symmetry

symmetry%20images

1 Like

Thanks Sean,

That works, however it seems logically strange that it needs to be done…?

I agree. It may be a bug and perhaps should be reported to GitHub, but I am glad it works for you for now!

This is verified in Dynamo 2.1. Issue closed here:https://github.com/DynamoDS/DynamoRevit/issues/2212