This tutorial will guide you through using the Image Metadata Randomizer to protect your privacy when sharing photos online.
- Install Python from python.org (version 3.6 or higher)
- Open a command prompt or terminal
- Set up a virtual environment (recommended):
python -m venv venv - Activate the virtual environment:
- On Windows:
.\venv\Scripts\activate - On macOS/Linux:
source venv/bin/activate
- On Windows:
- Install the required libraries:
pip install -r requirements.txt # Installs Pillow, piexif, ExifRead, PySide6
- With your virtual environment activated, run:
python metadata_gui.py - The application window will open.
- Add Files/Folders:
- Drag image files or folders directly onto the "Drag and Drop" area.
- Or, click "Select Files" or "Select Folder" to browse.
- Review List: Check the list to ensure the correct items are added.
- Preview Metadata (Optional): Click on an individual image file in the list on the left. Its current metadata will appear in the sidebar on the right.
- Randomize: Click the "Randomize Metadata" button.
- Check Results: Modified images are saved in their original locations with a
modified_prefix. If you had an image selected before clicking randomize, the sidebar will update to show the new metadata for the modified file.
If you prefer the command line:
-
Run the script providing the image path(s):
python image_metadata_randomizer.py "C:\Users\YourName\Pictures\vacation.jpg"Replace the path with the path to your image in quotes.
-
You'll see output showing the metadata changes.
-
The new image is saved in the same folder as your original with a "modified_" prefix.
To process multiple images at once via command line:
python image_metadata_randomizer.py "C:\Path\To\Image1.jpg" "C:\Path\To\Image2.jpg"
Or to process all images in a folder:
python image_metadata_randomizer.py --folder "C:\Users\YourName\Pictures\Vacation"
Previously, you could edit the script directly:
- Open
image_metadata_randomizer.pyin a text editor - Locate this line near the bottom:
original_image = r"C:\Users\Ray\Pictures\20170111_163529.jpg"
- Replace it with the path to your image:
(Keep the
original_image = r"C:\Users\YourName\Pictures\vacation.jpg"
rprefix before the path string - it's important!)
When you share a photo directly from your camera or phone, it typically contains information like this:
Metadata for C:\Users\YourName\Pictures\vacation.jpg:
Basic Image Information:
Make: Apple
Model: iPhone 13 Pro
Software: iOS 15.4.1
DateTime: 2023:06:15 14:22:33
Exif Information:
DateTimeOriginal: 2023:06:15 14:22:33
DateTimeDigitized: 2023:06:15 14:22:33
GPSLatitude: 34.052235
GPSLongitude: -118.243683
...
After running the script, the metadata looks like this:
Metadata for C:\Users\YourName\Pictures\modified_vacation.jpg:
Basic Image Information:
Make: Camera42
Model: Model78
Software: Software23
DateTime: 2022:11:03 09:15:47
Exif Information:
DateTimeOriginal: 2022:11:03 09:15:47
DateTimeDigitized: 2022:11:03 09:15:47
ExposureTime: 1/250s
FNumber: f/4.0
...
- Right-click on your modified image
- Select "Properties"
- Click on the "Details" tab
- You should see the randomized information
If you have IrfanView, XnView, or another metadata-capable image viewer:
- Open your modified image
- Look for a menu option like "Image Properties" or "EXIF Information"
- Verify the metadata has been changed
If Windows Explorer still displays the original metadata:
- Try right-clicking the file > Properties > Details tab
- Click "Remove Properties and Personal Information" at the bottom
- Choose "Create a copy with all possible properties removed"
- Run the randomizer on this new copy
- Ensure you're using the
rprefix before file paths to avoid escape character issues - Check that your image actually contains EXIF data (some web images don't)
- Make sure the image file isn't read-only or locked by another application
- Always verify the metadata has been properly changed before sharing
- Consider using batch processing for multiple images
- Keep the original files in a secure location
- Use dedicated privacy tools like this one before uploading to social media
- Remember that some platforms may strip metadata anyway, but don't rely on this behavior
When checking if your metadata has been properly randomized, focus on these key fields:
- Device information: Make, Model, Software
- Timestamps: All date/time fields
- GPS data: Should be completely removed
- Unique identifiers: SerialNumber, ImageUniqueID, etc.
By following this tutorial, you'll be able to better protect your privacy when sharing images online by removing potentially sensitive metadata.
