Java: Further cleanup of calculation. Correct image size from 512 to 768.

The code is much more readable and the image size is corrected. The new string fits in the image. Still a problem is the creation of garbage in the calculation. A first attempt which unrolls the vector operations looks promising.