Problem looping through a 4D array

Thanks for sticking with me @Chrisir!

For the moment, I won’t use RichardDL’s code - it only gives values for 3 pixels on in a 12-pixel grid, and we need ALL permutations for ALL ‘numbers of pixels on’.

I wrote some python code which generates all this data - so I think I should use that for now.

Yes, this makes sense - but because (for a 12-pixel matrix) there are 256 greyscale levels but only 12 pixels, so the number of ‘actual’ grayscale values will be 256/12 ≈ 21.

Thanks for your breakdown above. I’ve got the weekend free, so I hope to get to grips with it!

Here’s an image fo how I see it… Have I got the hierarchy right?

1 Like