Hacker News new | comments | show | ask | jobs | submit login
Visualize Randomness in OCaml (typeocaml.com)
14 points by jacksontale 732 days ago | hide | past | web | favorite | 8 comments



3d scatterplots dramatically visualize the flaws in the infamous RANDU: https://en.m.wikipedia.org/wiki/RANDU


Don't use jpeg format for this stuff, you'll end up just looking at blocking artifacts. Use PNG.


Can I know why?


The way JPEG works is by dividing up the image into 8x8 pixel blocks, then transforming each block using the discrete cosine transform (DCT). If you look closely at a JPEG file, especially at low quality settings, you can see the edges of the blocks. This means that artifacts have been introduced during the compression of the image. PNG however, is a lossless image compression format, meaning that no artifacts will be introduced by saving and loading an image in PNG.



You have a very high quality JPEG in this case, even bigger than the PNG. So there aren't visible artifacts in this case. It's more of a general principle.


But anyway, I updated teh post, so people could be aware of this diff.


ah ok, thanks.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: