Batch File Renaming and Conversion Script

April 18, 2025 ยท View on GitHub

Overview

This repository contains a very simple, yet effective script for using the OpenAI API to conduct batch file renaming operations. It is particularly suitable for processing a folder full of images that contain non-descriptive names, such as UUIDs or other random identifiers.

Features

  • Renames images in bulk for better organization and clarity.
  • Utilizes the OpenAI API to generate meaningful names for files.
  • Processes images quickly to rewrite their names.
  • Converts WebP images to PNG format during the renaming process.

Scripts

ScriptDescription
renamer.pyRenames images recursively based on their content using OpenAI's vision model
rename-and-convert.pyRenames images and converts WebP files to PNG format

Usage

  1. Place your images in a dedicated folder. Ensure that the images have non-descriptive names.
  2. Run the renamer script. It will process all images in the folder, renaming them to more meaningful titles based on their content.
  3. The script automatically converts any WebP images to PNG format, ensuring compatibility with various applications.