How to stream an image into camera source?

I was wondering if it’s possible to replace the camera kernel with any image that we like, from our gallery for exemple. Like if open my camera application the image that i’ve chosen will show.