An image processing device for generating display image data for displaying a main image and a sub image simultaneously or in a switching manner, the image processing device comprising: a main image data input means for receiving input of main image data representing the main image; a sub image data input means for receiving input of sub image data representing the sub image; a display mode acquisition means for acquiring display mode information indicating a display mode for displaying the main image or the sub image, or both the main image and the sub image simultaneously or in a switching manner; a first feature amount calculation means configured to receive the sub image data input to the sub image data input means or resized sub image data obtained by resizing the sub image data in accordance with the display mode information acquired by the display mode acquisition means, and use part or all of the image represented by the received image data to calculate a feature amount regarding image quality of the received image data; an image quality adjustment means for performing image quality adjustment on the resized sub image data to generate adjusted sub image data; a display image data generation means for generating the display image data from the main image data input to the main image data input means and the adjusted sub image data generated by the image quality adjustment means, in accordance with the display mode information acquired by the display mode acquisition means; and a second feature amount calculation means for calculating a feature amount regarding image quality of the display image data generated by the display image data generation means, wherein in a case where the display mode indicated by the display mode information shifts from a simultaneous display mode in which the main image and the sub image are displayed simultaneously or a main image display mode in which only the main image is displayed to a sub image display mode in which only the sub image is displayed, when the image quality adjustment means performs the image quality adjustment on the sub image data corresponding to the sub image display mode after the shift, the image quality adjustment means is configured to perform, based on a reference feature amount obtained from a feature amount of the display image data corresponding to the display mode before the shift calculated by the second feature amount calculation means, the image quality adjustment so that a difference between a feature amount of the adjusted sub image data and the reference feature amount is smaller than a difference between the calculated feature amount of the sub image data and the reference feature amount, and the reference feature amount is a feature amount that gradually varies from the feature amount of the display image data to a preset value. a main image data input means for receiving input of main image data representing the main image; a sub image data input means for receiving input of sub image data representing the sub image; a display mode acquisition means for acquiring display mode information indicating a display mode for displaying the main image or the sub image, or both the main image and the sub image simultaneously or in a switching manner; a first feature amount calculation means configured to receive the sub image data input to the sub image data input means or resized sub image data obtained by resizing the sub image data in accordance with the display mode information acquired by the display mode acquisition means, and use part or all of the image represented by the received image data to calculate a feature amount regarding image quality of the received image data; an image quality adjustment means for performing image quality adjustment on the resized sub image data to generate adjusted sub image data; a display image data generation means for generating the display image data from the main image data input to the main image data input means and the adjusted sub image data generated by the image quality adjustment means, in accordance with the display mode information acquired by the display mode acquisition means; and a second feature amount calculation means for calculating a feature amount regarding image quality of the display image data generated by the display image data generation means, wherein in a case where the display mode indicated by the display mode information shifts from a simultaneous display mode in which the main image and the sub image are displayed simultaneously or a main image display mode in which only the main image is displayed to a sub image display mode in which only the sub image is displayed, when the image quality adjustment means performs the image quality adjustment on the sub image data corresponding to the sub image display mode after the shift, the image quality adjustment means is configured to perform, based on a reference feature amount obtained from a feature amount of the display image data corresponding to the display mode before the shift calculated by the second feature amount calculation means, the image quality adjustment so that a difference between a feature amount of the adjusted sub image data and the reference feature amount is smaller than a difference between the calculated feature amount of the sub image data and the reference feature amount, and the reference feature amount is a feature amount that gradually varies from the feature amount of the display image data to a preset value.