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.
This commit is contained in:
@@ -791,8 +791,9 @@ class VideoEditor:
|
|||||||
processed_frame = self.apply_crop_zoom_and_rotation(self.current_display_frame.copy())
|
processed_frame = self.apply_crop_zoom_and_rotation(self.current_display_frame.copy())
|
||||||
|
|
||||||
if processed_frame is not None:
|
if processed_frame is not None:
|
||||||
# Save the processed frame
|
# Save the processed frame with high quality settings
|
||||||
success = cv2.imwrite(str(screenshot_path), processed_frame)
|
# 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:
|
if success:
|
||||||
print(f"Screenshot saved: {screenshot_name}")
|
print(f"Screenshot saved: {screenshot_name}")
|
||||||
self.show_feedback_message(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())
|
processed_image = self.apply_crop_zoom_and_rotation(self.static_image.copy())
|
||||||
|
|
||||||
if processed_image is not None:
|
if processed_image is not None:
|
||||||
# Save the image
|
# Save the image with high quality settings
|
||||||
success = cv2.imwrite(output_path, processed_image)
|
success = cv2.imwrite(output_path, processed_image, [cv2.IMWRITE_JPEG_QUALITY, 95])
|
||||||
if success:
|
if success:
|
||||||
print(f"Image saved successfully to {output_path}")
|
print(f"Image saved successfully to {output_path}")
|
||||||
return True
|
return True
|
||||||
|
Reference in New Issue
Block a user