changing image dpi

I have several hundred images at various dpi and I'd like to convert them all to 300 dpi. I can change the resolution manually with Preview or Photoshop CS5 and it's also easy to change all the image sizes with Automator, but I can't figure out how to automate a dpi conversion. Anyone have any suggestions?

MacBook Pro, Mac OS X (10.7), 15", 2.6 GHz Intel Core 2 Duo

Posted on Mar 4, 2012 9:19 PM

Reply
7 replies

Mar 5, 2012 4:06 AM in response to PyreFlos

Image size and dpi are interelated. The photo contains a fixed number of dots. Without using some interpolation by a graphics program to manufacture more dots based on surrounding dots, you can't create more dots.

If you make the picture size larger, the dots per inch decreases because there are no more dots to fill the gaps.

dpi = dots / size (inches)

Likewise, if you make the picture size smaller, the dpi increases as the same number of dots needs to fill a smaller space.

Mar 5, 2012 2:09 PM in response to Barney-15E

Barney, you're right. However, I'm not interested in scaling the images, just changing the dpi. If you open an image in Preview and click Adjust Size under the Tools menu, you can change the resolution (pixels per inch) without modifying dimensions (height and width in pixels).


Some programs, such as Indesign and Illustrator, read the dpi property from an image file and auto scale the image based on that number. So a 600px wide image with a recorded dpi of 300 will automatically import at 2 inches wide, while a 600px wide image with a recorded dpi of 36 will come in at 16.67 inches. Both images are technically the same size, but the software doesn't treat them the same. The 2 inch image will look great on any printer, while the 16.67 inch image will be trash.


My question revolves around me trying to save time and energy. I don't want to manual rescale 900 images after importing them, especially if I can automate the process. I suppose I should have been more specific in the original post.

Feb 1, 2014 12:03 AM in response to Kurt Lang

The problem with using Photoshop just to change the resolution is that when Photoshop re-saves images, it often adds a significant amount of extra weight to the file size.


For example: I made a Photoshop action that changes the DPI without resampling (i.e. it doesnt add or remove pixels to the images dimensions, only changes the DPI value). Running this action on a 17.6 MB folder of JPGs resulted in the size almost doubling to 32.8 MB.


Sure, you could adjust the image quality settings in the action, but the whole point is not wanting to affect the amount or quality of the data, just its default pixel density.


So, to repeat the question: Is there any way file:///.file/id=6571367.30271068to use Automator to change just the image's DPI numbers without effecting the image dimensions?

Feb 1, 2014 8:24 AM in response to nickrobots

it often adds a significant amount of extra weight to the file size.

There are a couple of ways that can happen, but if you're going JPEG to JPEG, the sizes will be identical (or at least very nearly so) as long as the quality level from original to the resaved image is the same.

Running this action on a 17.6 MB folder of JPGs resulted in the size almost doubling to 32.8 MB.

Which is exactly what would be expected to happen if the originals were saved with an (example) quality level of 7, and were resaved to 12.


I already knew this would be the outcome, but ran a test anyway. I saved seven random TIFF images to a level 7 JPEG, Baseline (Standard). No matter how many generations I performed the same action to the original level 7 JPEGs, or subsequent copies, the sizes always came out the same. If I saved the level 7 JPEGs to level 12, then they jumped up in size. From 1.6 MB for the level 7 set of images, to 4.1 MB at 12.


The worst part of course being that anytime you save a JPEG as a JPEG you are applying JPEG compression again. Compounding the unavoidable JPEG artifacts in each resaved image. Which you already know, as you stated:

but the whole point is not wanting to affect the amount or quality of the data

The problem is, you can't adjust the DPI without resaving the image. That value is stored in the file itself. The only way to make the change stick is to resave.


Personally, I won't, and have never used JPEG to save my images. Always uncompressed TIFF for flattened images, or PSD for layered finals. Why any Joint Photographic Experts Group users ever decided that a lossy format was a good idea is anyone's guess. You would think the very last file format any professional photographer would use to save their images is one that ruins them by default. I will get a bigger drive to store my data over lossy compression any day of the week.


If you want to save space, use TIFF with Zip or LZW compression. Both will save a good amount of space over an uncompressed TIFF and are both lossless compression schemes.

Feb 7, 2014 10:38 PM in response to Kurt Lang

The problem is, you can't adjust the DPI without resaving the image. That value is stored in the file itself. The only way to make the change stick is to resave.


Obviously the value is stored within the file, but it is stored as meta data. As such, you shouldn't need to alter the image data in order to change it. The concept is similar to how you can change other meta data like the time stamp or EXIF info without having to affect the image's pixels.


Unfortunately, as far as I know, you can't use Photoshop to edit just meta data separately from the pixels. Photoshop will always re-process the image when resaving an image. And, as both of us have acknowledged, that is not good for JPGs. Automator, on the other hand, seems to do a good job of dealing with meta data separately.


The reason for using JPG instead of TIFF is a matter of file size. I am willing to accept some loss in image quality with JPGs because otherwise, even with compression, the TIFF version of the same image is literally 5 times larger. When transferring a document via the web that has many large images, it is often the best (and sometimes the only) practical option.


So, unfortunately, the question still remains unanswered: Is there any way to use Automator to change just the image's DPI numbers without affecting the image dimensions?

Feb 8, 2014 8:47 AM in response to nickrobots

Obviously the value is stored within the file, but it is stored as meta data. As such, you shouldn't need to alter the image data in order to change it.

Yes, but that's not the way any software I've ever seen saves an image. They all rewrite the entire record of data, regardless of whether the image pixels have changed or not.


Not the answer you want to hear, but the answer is no, you can't change the resolution without affecting the image. At least not when using a lossy image format. Could they, should they save an unchanged JPEG by simply copying the image data tag from the old file to the new one instead of recompressing the uncompressed image data you're working from in RAM? Yes, it should be easy to do, but no software does that.


I took a handful of test TIFF images and saved them as TIFF with LZW compression; TIFF with ZIP compression; and JPEG at the highest quality level (noted as 12 in Photoshop), baseline Standard. Note that LZW and ZIP compression in TIFF is lossless. Image quality never changes.


All sizes in MB.


Uncompressed TIFF:


File 1: 52.7

File 2: 13.8

File 3: 10.4

File 4: 8.1


TIFF with LZW compression:


File 1: 17.7

File 2: 5.8

File 3: 5.6

File 4: 5


TIFF with ZIP compression:


File 1: 15.5

File 2: 5.1

File 3: 5.1

File 4: 4.6


JPEG level 12


File 1: 7.3

File 2: 2.8

File 3: 2.5

File 4: 2


Nod goes to JPEG of course for total space savings, but you're still losing image data, even on the first save.


TIFF with ZIP is slightly better than LZW, but takes a long time to save and open, and older software titles may not be able to open them.


TIFF with LZW saves almost instantly compared to ZIP (almost the same as uncompressed) and has been around forever. Pretty much any image editor can read it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

changing image dpi

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.