Save result image with rectangles

I can’t understand how to save result image to jpg.
JPG with rectangles and background image.