Fixed halftoning.java to allow saving and sharing