3 ms·
These are definitely interesting. They make me wonder what the underlying continuous function is, and if it's the same function for all the pictures. These mos
by dahart 9y ago
These are definitely interesting. They make me wonder what the underlying continuous function is, and if it's the same function for all the pictures.
These mostly look like aliasing to me. Which makes sense, perhaps is nearly obvious, because that's what you get when you plot the mod of a multiply on a grid.
It's pretty easy to reproduce something close to the large image (prime 9973), by just plotting the continuous function "(x * y) % 2", or even sin(x * y):
https://www.dropbox.com/s/3eayuknh1urayay/001.jpg?dl=0 https://www.dropbox.com/s/3eayuknh1urayay/001.jpg?dl=0
As a graphics person, what I normally do is try to remove that aliasing by using more samples.
https://www.dropbox.com/s/imx6njdek3wello/002.jpg?dl=0 https://www.dropbox.com/s/imx6njdek3wello/002.jpg?dl=0
And for nasty functions like this one, you find out that more samples doesn't fix the aliasing. See the hints of it still there far away from the center?
That's when you get into the fun signal processing math and have to use a better filter function to remove all aliasing:
https://www.dropbox.com/s/ysoibo3v8j9b2gg/003_gauss.png?dl=0 https://www.dropbox.com/s/ysoibo3v8j9b2gg/003_gauss.png?dl=0
- sp332 9y agoIt reminded me of a moiré pattern. https://en.wikipedia.org/wiki/Moir%C3%A9_pattern#/media/File:Moire_Lines.svg https://en.wikipedia.org/wiki/Moir%C3%A9_pattern#/media/File...
- dahart 9y agoThat's exactly what it is! You need two patterns for moire, so in my case one is the continuous function, the other is the pixels (or sampling). If I sample every other pixel, I get a completely different moiré.
- madez 9y agoCould you elaborate on the signal processing and the filter function?
- tapatio 9y agoThis video will give you a quick overview of aliasing and an anti-aliasing filter: https://www.youtube.com/watch?v=v7qjeUFxVwQ https://www.youtube.com/watch?v=v7qjeUFxVwQ
- tapatio 9y agoIf you have more time, this is more thorough: https://www.youtube.com/watch?v=yWqrx08UeUs https://www.youtube.com/watch?v=yWqrx08UeUs
- dahart 9y agoSure, yeah. So the second of the three images I posted above, I generated using 25 samples of the function per pixel. To get the pixel color, I averaged the 25 samples. What's interesting about averaging is that you can never get rid of some kinds of aliasing no matter how many samples you use (the ghost waves you can see along the axes, near the outside of the image). It can be surprising to use 10,000 samples per pixel and still have ghost waves. The reason is that averaging is almost the same thing as using a "box filter" meaning you can think of it as a response function for each pixel where the shape of the response function is constant over the pixel (or sample), and 0 outside the pixel - so shaped like a box. The third image uses a Gauss response function - as in the standard normal distribution (e ^ -x^2). This function spreads each sample around into neighboring pixels, and the result is that the image is just slightly blurrier, but you can get rid of all ghosting. There are better response functions (or kernels) that are less blurry than Gauss, but I happen to personally like Gauss when generating very high quality and very large poster prints. The other people here gave links to Nyquist theory:(https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampli...) Knowing the theory is generally good, but I also enjoy resources that talk about image processing specifically, it's closer to home and more concrete, there are more visual examples. Google "image resampling" https://en.wikipedia.org/wiki/Kernel_(image_processing) https://en.wikipedia.org/wiki/Kernel_(image_processing) Image magick has some examples in their docs: http://www.imagemagick.org/Usage/resize/ http://www.imagemagick.org/Usage/resize/ This one's mathy, but has lots of diagrams and examples: http://eeweb.poly.edu/~yao/EL5123/lecture8_sampling.pdf http://eeweb.poly.edu/~yao/EL5123/lecture8_sampling.pdf
- jacobolus 9y agoThere’s not really a reasonable continuous analog, IMO (unless you just want to see a single solid blob, like in your picture, but that hides all of the interesting part of the structure). But there are moiré-like patterns. Check out https://www.youtube.com/watch?v=qhbuKbxJsk8 https://www.youtube.com/watch?v=qhbuKbxJsk8 for some insight based on a related type of diagram (related to a single row at a time from the OP’s diagrams).
- dahart 9y agoThat was awesome thanks for sharing. For the first minute I wasn't expecting much, but the reflections part was so cool! Plus, this connects directly to the cyclic curves in the complex plane, e.g., https://mathlesstraveled.com/2015/06/04/random-cyclic-curves-5/ https://mathlesstraveled.com/2015/06/04/random-cyclic-curves... The curves formed by the envelope of intersecting lines in the circular multiplication table are a slice of cyclic curve space. I animated this after reading the above blog post: https://youtu.be/myGXoLCnx-A https://youtu.be/myGXoLCnx-A You can see some of the curves in the lower left corner are the same ones from Mathologer.