implemented the out image to generate