Continuous optimization for imaging