| import cv2 | |
| from pathlib import Path | |
| # Get all collage files | |
| collage_dir = "collages_1to5" | |
| collage_files = sorted(Path(collage_dir).glob("collage_*.png")) | |
| print(f"Found {len(collage_files)} collages") | |
| print("Controls: Press any key for next image, 'q' or ESC to quit") | |
| for i, collage_path in enumerate(collage_files): | |
| # Read image | |
| img = cv2.imread(str(collage_path)) | |
| # Resize for display (original is 1000x5000, too large for screen) | |
| # Scale down to fit screen | |
| scale = 0.18 # Adjust this to fit your screen | |
| height, width = img.shape[:2] | |
| new_width = int(width * scale) | |
| new_height = int(height * scale) | |
| img_resized = cv2.resize(img, (new_width, new_height)) | |
| # Show image | |
| window_name = f"Collage {i+1}/{len(collage_files)} - {collage_path.name}" | |
| cv2.imshow(window_name, img_resized) | |
| print(f"Showing {collage_path.name} (resized to {new_width}x{new_height})") | |
| # Wait for key | |
| key = cv2.waitKey(0) | |
| # Close current window | |
| cv2.destroyWindow(window_name) | |
| # Check for quit | |
| if key == 27 or key == ord('q'): # ESC or 'q' | |
| print("Quitting...") | |
| break | |
| cv2.destroyAllWindows() | |
| print("Done!") |