Compute all statistics and only write the HDF5 file.

Updating the statistics is much quicker than localising. This
change simplifies the code a lot.
Draw a color bar next to the result image.
Add single letter option 's' to set the seed.