To change the DPI of a JPG using ExifTool, use the command exiftool -dpi=300 image.jpg. This metadata-only adjustment ensures Photoshop recognizes the new resolution without altering pixel data. The tool is available on Linux, Windows, and macOS.
Understanding DPI in Digital Images
Dots Per Inch (DPI) is often confused with PPI (Pixels Per Inch), but for digital files, they function similarly as density markers. In the context of JPEG images, DPI is stored within the EXIF metadata rather than being baked into the pixel grid itself. This distinction is crucial because changing the DPI value does not resize the image or change its physical dimensions on screen; it only tells printing software and applications like Adobe Photoshop how many dots should be printed per inch. When you view an image in most web browsers or standard photo viewers, the DPI setting is ignored because screens display pixels directly. However, when preparing images for print or professional workflows, this metadata becomes critical. If your image is 1920x1080 pixels and set to 72 DPI, Photoshop interprets it as a small, low-resolution print. Changing it to 300 DPI tells the application that those same pixels should be packed tighter, resulting in a smaller physical print size but higher quality output. For users migrating from other tools, it is important to note that while ImageMagick can also handle this task, ExifTool is generally preferred for its precision and lack of side effects. Unlike some converters that might re-encode the image, ExifTool modifies the header information exclusively. This preserves the original file integrity and avoids generation loss associated with recompression.Installing ExifTool Across Platforms
ExifTool is a Perl script distributed by Phil Harvey, and it is pre-installed on many Linux distributions due to its popularity among system administrators. On Windows and macOS, you must download the binary separately. On Linux systems, you can typically install it via your package manager. For Debian-based systems like Ubuntu, usesudo apt-get install libimage-exiftool-perl. For Red Hat-based systems, the command is sudo yum install perl-Image-ExifTool. Note that simply typing yum install ImageMagick is incorrect if your goal is specifically ExifTool functionality, as these are distinct packages with different capabilities. Always verify the installation by running exiftool -ver in your terminal.
Windows users should download the zip archive from the official website. Extract the contents to a folder, such as C:\ExifTool, and add this path to your system's environment variables. This allows you to run the exiftool command from any directory in the Command Prompt or PowerShell.
macOS users have two primary options. You can download the standalone Mac executable from the official site, or use Homebrew. The Homebrew method is often cleaner for developers: brew install exiftool. Once installed, the command is available globally in your shell.
Changing DPI Using the Command Line
The core syntax for modifying DPI is straightforward. To set the horizontal and vertical resolution to 300 DPI, execute the following command in your terminal or command prompt:exiftool -dpi=300 image.jpg
This command creates a backup file named image.jpg_original by default. This safety feature is highly recommended because EXifTool overwrites the original file unless specified otherwise. If you wish to skip the backup creation to save disk space, you can add the -overwrite_original flag:
exiftool -overwrite_original -dpi=300 image.jpg
It is worth noting that the -dpi tag sets both X and Y resolution simultaneously. If you need different values for width and height, you can use -XResolution and -YResolution. However, for standard printing, keeping them equal is best practice.
Some users attempt to remove DPI settings entirely to force software to ignore them. While one might think to use ResolutionUnit=NONE, this syntax is invalid in ExifTool. Instead, to clear the resolution unit, you would use -resolutionunit=none. However, removing the unit doesn't remove the numerical value. To truly strip the metadata, you would need to target specific tags like -xres= and -yres=.
After running the command, you can verify the change by reading the metadata back:
exiftool -XResolution -YResolution image.jpg
If the output shows X Resolution : 300 and Y Resolution : 300, the modification was successful. Open the file in Photoshop to confirm that the "Image Size" dialog reflects the new physical dimensions based on the 300 DPI setting.
Batch Processing Multiple Files
In professional environments, you rarely deal with single images. ExifTool handles batch operations efficiently. To change the DPI of all JPG files in a directory, simply pass the wildcard pattern to the command:exiftool -dpi=300 *.jpg
This will process every JPEG in the current folder. Be cautious with wildcards, as they apply recursively if you use -r (recursive flag). Without -r, only files in the immediate directory are affected.
If you need to target subdirectories, add the recursive flag:
exiftool -r -dpi=300 ./
This approach is significantly faster than opening each file in a GUI editor. It also ensures consistency across large datasets, which is vital for print production pipelines where uniform metadata standards are required.
For more advanced filtering, such as targeting only images below a certain resolution, you can combine conditions. However, since DPI is metadata and not derived from pixel count, you cannot filter by DPI value easily without first reading it. A common workflow is to check existing DPIs first, then apply changes only to those that differ from the target.
Related resources may include guides on converting time-lapse sequences or managing local server configurations, though these are distinct from image metadata editing tasks.
Frequently Asked Questions
Does changing DPI resize the image?
No, changing the DPI value only alters the metadata header. The actual pixel dimensions (e.g., 1920x1080) remain unchanged. Resizing requires explicit commands like-resize in ExifTool or using image manipulation libraries.
Why does Photoshop still show the old size?
Photoshop caches metadata. Close and reopen the file after running the ExifTool command. If it persists, ensure the file was saved correctly and that no other plugins are overriding the metadata read.Can I set different DPI for width and height?
Yes, but it is uncommon. Use-XResolution=300 -YResolution=600. Most printers expect square pixels, so mismatched DPIs can distort printed output.
Is ExifTool safe for RAW files?
Yes, ExifTool supports RAW formats like CR2, NEF, and ARW. It modifies the embedded JPEG preview or the main header without altering the raw sensor data, making it safe for professional workflows.How do I remove DPI metadata completely?
Use-xres= -yres= to clear the resolution values. This forces applications to use their default assumptions or ignore density settings entirely.