
Visualize Randomness in OCaml - jacksontale
http://typeocaml.com/2015/11/22/visualise_random/
======
blt
3d scatterplots dramatically visualize the flaws in the infamous RANDU:
[https://en.m.wikipedia.org/wiki/RANDU](https://en.m.wikipedia.org/wiki/RANDU)

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

~~~
jacksontale
Can I know why?

~~~
Ono-Sendai
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.

~~~
jacksontale
Just tried, but seems not that different

\----------------

PNG:

[https://raw.githubusercontent.com/MassD/typeocaml_code/maste...](https://raw.githubusercontent.com/MassD/typeocaml_code/master/visualise_randomness/random_plot_time.png)

\-------------

JPG:

[https://raw.githubusercontent.com/MassD/typeocaml_code/maste...](https://raw.githubusercontent.com/MassD/typeocaml_code/master/visualise_randomness/random_plot_time.jpg)

~~~
Ono-Sendai
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.

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

