Skip to content

zeande/ImageCleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageCleanup

Overview

ImageCleanup is a collection of scripts designed to help organize and clean up your photo collection. Over the years, many of us have accumulated a large number of photos stored across various cloud services. This project aims to streamline the process of managing these photos by downscaling large images and removing duplicates. After using the scripts in this repository, you will be ready to import your photos into the cloud service of your choice. with a much smaller footprint than taking them over as-is.

Features

  • Downscale Images: Reduce the size of large images to save cloud storage space.
  • Deduplicate Images: Identify and remove duplicated photos.
  • Set Created Date: Update the file creation time of photos to ensure proper sorting.

Getting Started

Prerequisites

  • Python 3.x
  • Required Python libraries (listed in requirements.txt)

Installation

  1. Clone the repository:
    git clone https://github.com/zeande/ImageCleanup.git
  2. Navigate to the project directory:
    cd ImageCleanup
  3. Install the required libraries:
    pip install -r requirements.txt

Usage

Compress-Images

This script creates downscaled copies of the images in a specified directory.

.\scripts\Compress-Images.ps1 -directoryPath "C:\path\to\images" -maxDimension 1024
  • imagesPath (string, mandatory): The path to the directory containing the images to be downscaled.
  • maxDimension (int, optional): The maximum dimension (width or height) for the downscaled images. Default is 2048.
  • fileExtensions (string[], optional): An array of file extensions to include in the search. Default is @(".jpg", ".png").

Move-DuplicateImages

This script identifies and moves duplicate images from a specified directory to a separate folder for manual review and removal. Make sure to keep one of each duplicate set and move it back to the original folder.

.\scripts\Move-DuplicateImages.ps1 -directoryPath "C:\Photos"
  • directoryPath (string, mandatory): The path to the directory containing the images to be checked for duplicates.
  • fileExtensions (string[], optional): An array of file extensions to include in the search. Default is @(".jpg", ".png").
  • differenceThreshold (int, optional): The threshold for determining whether two images are considered duplicates. Default is 10.
  • lookAhead (int, optional): The number of subsequent images to compare with a particular image. Default is 5.
  • deleteDuplicates (switch, optional): If specified, duplicate images will be deleted instead of moved. Only use this if you know what you are doing or have the photos backed up elsewhere.

Set-CreatedDate

This script updates the 'Date Created' and 'Date Modified' metadata of the image files based on the 'Date Taken' property (if present) or the date in the filename.

.\scripts\Set-CreatedDate.ps1 -directoryPath "C:\Photos"
  • directoryPath (string, mandatory): The path to the directory containing the images to update.
  • fileExtensions (string[], optional): An array of file extensions to include in the search. Default is @(".jpg", ".png").

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

Contact

For any questions or suggestions, please open an issue on GitHub.

About

Clean up all the images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published