Using the deep learning toolbox, we present a joint-design approach of parametrizing the optical formation of images and the reconstruction process using an end-to-end framework. We solve a classic problem, extended depth of field (EDoF), by producing a learned optical phase mask. The computational camera hardware verifies the results with a spatial light modulator (SLM). Our framework lays the foundation for learning-based joint-design with a non-regular phase mask and neural networks for image reconstruction.