Image pixel symmetry


#1

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.


#2

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.


#3

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)


#4

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.


#5

Thanks Sean,

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


#6

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


#7

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