Automatically Naming the Screenshots to Steam
The Problem
I want to upload my own screenshot to steam, but I found that the methods I found are a bit tedious.
Steam expects screenshots to follow a specific naming convention in its screenshot
and thumnails
folders:
YYYYMMDDHHMMSS_N.jpg
Where:
YYYYMMDDHHMMSS
is the timestampN
is a sequence number.jpg
is the required file format
Solution
I wrote a Python script to automate this process
import os
import shutil
from PIL import Image
from datetime import datetimedef copy_images(source_folder, destination_folder, resize_thumbnails=True, thumbnail_size=(200, 125)):"""Copy all image files from source folder to destination folder with timestamp-based naming.Optionally create thumbnails in a subfolder.Args:source_folder (str): Path to source folder containing imagesdestination_folder (str): Path to destination folderresize_thumbnails (bool): Whether to create thumbnailsthumbnail_size (tuple): Size for thumbnails if enabled"""image_extensions = ('.jpg', '.jpeg', '.png', '.bmp', '.gif', '.tiff')os.makedirs(destination_folder, exist_ok=True)if resize_thumbnails:thumbnails_folder = os.path.join(destination_folder, 'thumbnails')os.makedirs(thumbnails_folder, exist_ok=True)copied_files = 0sequence_number = 1 # Starting sequence number# Get current timestamp in YYYYMMDDHHMMSS formattimestamp = datetime.now().strftime("%Y%m%d%H%M%S")for filename in os.listdir(source_folder):if filename.lower().endswith(image_extensions):source_path = os.path.join(source_folder, filename)try:new_filename = f"{timestamp}_{sequence_number}.jpg"destination_path = os.path.join(destination_folder, new_filename)with Image.open(source_path) as img:if img.mode in ('RGBA', 'P'):img = img.convert('RGB')img.save(destination_path, 'JPEG', quality=95)copied_files += 1print(f"Saved: {new_filename}")if resize_thumbnails:thumbnail_path = os.path.join(thumbnails_folder, new_filename)thumb = img.copy()thumb.thumbnail(thumbnail_size)thumb.save(thumbnail_path, 'JPEG', quality=90)print(f"Created thumbnail: {new_filename}")sequence_number += 1except Exception as e:print(f"Error processing {filename}: {str(e)}")print(f"\nDone! Saved {copied_files} images to {destination_folder}")if resize_thumbnails:print(f"Created thumbnails in {thumbnails_folder}")if __name__ == "__main__":# Example usagesource = "C:\\Users\\miyas\\Pictures\\VRChat\\SELECT" # change to your pathdestination = "X:\\steam\\userdata\\861267303\\760\\remote\\438100\\screenshots" # change to your pathcopy_images(source, destination, resize_thumbnails=True)
How to Use the Script
-
Install Requirements:
pip install pillow
-
Edit the Paths:
- Change
source
to your screenshot folder - Change
destination
to your Steam screenshots folder (usually insteam/userdata/[yourID]/760/remote/[appID]/screenshots
)
- Change
-
Run the Script:
python upload.py
After the process done, restart steam and you will see the customized pictures in the screenshot manager.
Key Features
- Automatic Timestamping: Uses current time for proper Steam format
- Format Conversion: Converts all images to JPG automatically
- Thumbnail Generation: Creates 200x125 thumbnails in a subfolder