From ea1a6e58f477736477a2b2a63add27d0854c3d44 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 19 Sep 2025 07:17:52 +0200 Subject: [PATCH] Enhance image and screenshot saving quality in VideoEditor This commit updates the image and screenshot saving functionality in the VideoEditor class to use high-quality JPEG settings. The JPEG quality is set to 95, ensuring better image fidelity when saving processed frames and static images. --- croppa/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/croppa/main.py b/croppa/main.py index ab0718f..2a96d4a 100644 --- a/croppa/main.py +++ b/croppa/main.py @@ -791,8 +791,9 @@ class VideoEditor: processed_frame = self.apply_crop_zoom_and_rotation(self.current_display_frame.copy()) if processed_frame is not None: - # Save the processed frame - success = cv2.imwrite(str(screenshot_path), processed_frame) + # Save the processed frame with high quality settings + # Use JPEG quality 95 (0-100, where 100 is highest quality) + success = cv2.imwrite(str(screenshot_path), processed_frame, [cv2.IMWRITE_JPEG_QUALITY, 95]) if success: print(f"Screenshot saved: {screenshot_name}") self.show_feedback_message(f"Screenshot saved: {screenshot_name}") @@ -2716,8 +2717,8 @@ class VideoEditor: processed_image = self.apply_crop_zoom_and_rotation(self.static_image.copy()) if processed_image is not None: - # Save the image - success = cv2.imwrite(output_path, processed_image) + # Save the image with high quality settings + success = cv2.imwrite(output_path, processed_image, [cv2.IMWRITE_JPEG_QUALITY, 95]) if success: print(f"Image saved successfully to {output_path}") return True