https://github.com/vybhav72954/duplicate_images
A python script to find and delete (optionally) deleted photos using MD5 Hash.
https://github.com/vybhav72954/duplicate_images
contributions-welcome hacktoberfest hashing image md5
Last synced: 3 months ago
JSON representation
A python script to find and delete (optionally) deleted photos using MD5 Hash.
- Host: GitHub
- URL: https://github.com/vybhav72954/duplicate_images
- Owner: vybhav72954
- License: gpl-3.0
- Created: 2020-10-17T19:52:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-20T17:48:35.000Z (over 4 years ago)
- Last Synced: 2025-01-20T17:50:47.118Z (4 months ago)
- Topics: contributions-welcome, hacktoberfest, hashing, image, md5
- Language: Python
- Homepage:
- Size: 7.95 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Duplicate Image Finder
[](https://www.python.org/)
Many a times, we find duplicate images residing in our Albums, Image_directory etc, there ane various reasons,
downloading same file form various sources, auto backup on cloud, it slipped out of our mind that we downloaded it
already in the first place etc. Manually selecting them is actually a hassle, but why do such boring task when
automation can do the trick. This sweet and simple script, helps you to compare various files (not only images) in a
directory, find the duplicate, list them out, and then even allows you to delete them.
**Sweet!!!**## Setup
- Setup a `python 3.x` virtual environment.
- `Activate` the environment
- Install the dependencies using ```pip3 install -r requiremnts.txt```
- You are all set and the [script](image_finder.py) is Ready to run.
- Clearly Follow the Instructions provided in the comments.### Usage
In Command Line Interface, Run the script using -
`python image_finder.py `
1. folder1 - *Parent Folder*
2. folder2, folder3 .... - *Subsequent Folders*
>Comparisons are done with in the folder, and from Parent to Subsequent Folders.## Dependencies
1. python3
2. keyboard## Detailed explanation
The Script works on a simple fundamental. Two files with same [`md5checksum`](https://en.wikipedia.org/wiki/MD5) will
have similar contents. So in the script all we aim to do is determine the checksum, compare and find the duplicates.#### Folder Structure
- **[Stand_Alone](./img/Stand_Alone)** folder has 6 images, 2 of them are duplicate of images within the folder only.
- **[Parent](./img/Parent)** contains standard images used for Image Processing in *png* format.
- **[Duplicate](./img/Duplicate)** folder contains 5 images duplicate of images in Stand_Alone (named `Random Name (n)`).
There are similar images in *tiff* extension as well, They are not Duplicate as file type is different.
- **[Duplicate_1](./img/Duplicate_1)** folder contains another 5 images duplicate of images in Stand_Alone
(named `Another Random Name (n)`). There are similar images in *jpeg* extension as well, They are not Duplicate as file
type is different.## Output
- Running Script on a single folder `Stand_Alone`. In this example I pressed [n] in order to not to delete anything.

- Stand_Alone folder Before Deleting the files.
.PNG)
- After Deleting the Files, i.e. Pressing [y] at the prompt.
.PNG)
- `Parent`, `Duplicate`, `Duplicate_1` folder before running the script.

- Running the scripts on the Folder and deleting the duplicate files.


- Final Result, Notice that all the files in `Parent` Folder remain as it is.

## Author(s)
Made by [Vybhav Chaturvedi](https://www.linkedin.com/in/vybhav-chaturvedi-0ba82614a/)
Check [Rotten Scripts](https://github.com/HarshCasper/Rotten-Scripts) for more such awesome Scripts and useful codes.