Author Topic: Why does DPI Matter?  (Read 3283 times)

0 Members and 1 Guest are viewing this topic.

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1840
  • Country: 00
Why does DPI Matter?
« on: November 09, 2017, 04:41:35 pm »
One marketing person to another is requesting all images be set to 300dpi. Marketing person comes to me and asks if Paint can do that!

I contend there is no need for 300dpi setting as that only applies to print, and would depend on how the image gets processed. Sure, you want to print 300dpi, I say, but it is important that you have enough pixels to print the size that you want. So, the number of pixels will tell the max size you can print at a particular resolution.

I say the dpi setting in the file is merely semantic metadata and how it's used depends on the application processing the image. For example, Paint is not going to care if the image is set to 72, 96, or 300dpi, it will look the same... amiright?

Anyway, to appease their request, is anyone familiar with how to set up a batch process and application that can change this little piece of data in tiff, png, and jpeg images? I have the Adobe suite (photoshop and bridge).
 

Offline jm_araujo

  • Regular Contributor
  • *
  • Posts: 62
  • Country: pt
Re: Why does DPI Matter?
« Reply #1 on: November 09, 2017, 04:47:05 pm »
DPI only have meaning in the physical world.

You can do the batch processing with Irfanview (freeware) in "File"->"Batch Conversion"->"Batch Conversion settings:"->"Advanced"->"Set new DPI value". It's not the most intuitive, but it's very capable.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 9668
  • Country: us
Re: Why does DPI Matter?
« Reply #2 on: November 09, 2017, 04:49:37 pm »
They probably mean that images should be at least 300 dpi, so that when printed they look good. I don't see any reason to reduce a better quality image, and up-scaling lower quality images is pointless as you can't put back any detail that isn't already there.

When these requests are made, it usually means that any new images created or contributed should be of sufficient quality. It doesn't mean you should batch process existing images. Existing images are what they are. Good or bad, you can't change them, only replace them with better ones.
I'm not an EE--what am I doing here?
 

Offline Tom45

  • Frequent Contributor
  • **
  • Posts: 431
  • Country: us
Re: Why does DPI Matter?
« Reply #3 on: November 09, 2017, 05:09:55 pm »
The dpi value (actually ppi) is just a tag in the file. It is meaningless. What matters is the number of pixels.

Unfortunately, a lot of people think dpi is very important and you will have no chance of convincing them otherwise. So just tag the file at whatever they want and get on with your life.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1840
  • Country: 00
Re: Why does DPI Matter?
« Reply #4 on: November 09, 2017, 05:14:57 pm »
That's where I am, Tom.

Note that I would not resample an image - a 96 dpi 300 x 300 pixel image would still have 9000 pixels in the end, just that semantic attribute would change from 96 to 300. Both would print a 1" square.

Company has blocked Irfanview.
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3015
  • Country: us
Re: Why does DPI Matter?
« Reply #5 on: November 09, 2017, 05:23:18 pm »
Some web browsers (and image viewers) also display images differently depending on their ppi tag. So a 4000x3000 image at 1200 ppi may display in a small area of the screen. This is the preferred behavior, because showing a tiny corner of the file at 100% is useless.

"DPI is only meaningful in the physical world" is an unfortunate assumption, much like "640K will be enough for everybody". It has held back scalable user interfaces for decades.

While I'm at it, the other assumption in image software that bites me all the time is that there is any meaning to the data in a non-ICC profile tagged image. Images without ICC profiles should simply not be allowed, as there is no way to reconstruct what their data means.
« Last Edit: November 09, 2017, 05:27:45 pm by helius »
 

Offline Peabody

  • Frequent Contributor
  • **
  • Posts: 772
  • Country: us
Re: Why does DPI Matter?
« Reply #6 on: November 09, 2017, 05:43:56 pm »
I agree that it's virtually impossible to get someone off the 300 DPI requirement.  It's like trying to get them to change their religion.

There's a program called EXIFTool.  I haven't used it, but it should be able to change the DPI without re-rendering anything.

You might also want to check a sample JPG and see if there is actually an EXIF entry for DPI.  If not, that information may be in the file header where you could change it with a hex editor.  It will begin at the 15th byte of the file (at location 000E):

00 48
00 48

Those are the vertical and horizontal DPI values,  normally the same.  48 in hex is 72 in decimal.  To change those to 300, change the bytes to:

01 2C
01 2C

Be sure to Overwrite, not Insert.  Then save the modified file.

Maybe someone has written a script to do that on a batch of files.  It should be the same change beginning at the same location for all the files.


 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3321
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Why does DPI Matter?
« Reply #7 on: November 09, 2017, 06:23:39 pm »
I think there is a reason for the marketing guy to request 300dpi images even for web material, as those images would look nicer on a device with high DPI display (like recent iPhones, or people with 4K monitors - I have both, and it does make a difference.)

However unless they are using photos, it may be better to use vector graphics like SVG for graphs or drawings. Vector graphics files are way smaller, and can scale up or down perfectly indefinitely (that is, it is still crisp sharp when blown up to the size of a building or scaled down to chip art) all because at heart vector graphics is just a bunch of mathematical equasions describing the shapes.
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3015
  • Country: us
Re: Why does DPI Matter?
« Reply #8 on: November 09, 2017, 06:24:46 pm »
Code: [Select]
#!/bin/bash

program=`basename $0`

while (( $# > 0 )); do
    case "$1" in
        --help|-h)
            echo "Changes the dpi setting of a JFIF file or files."
            echo "usage: $program --dpi [decimal] file1 file2 ... fileN"
            exit 0
            ;;
        --dpi)
            dpi=$2
            shift
            ;;
        -*)
            echo "$program: $1: unknown option"
            exit 1
            ;;
        *)
            args+=("$1")
    esac
    shift
done

printf -v xdpi "%.4x" ${dpi:?DPI unspecified}

for f in "${args[@]}"; do
    [[ `xxd -p -l14 "$f"` =~ ffd8ffe0[0-9a-f]{4}4a46494600010[012]0[12] ]] && \
    echo "000000d: 01 $xdpi $xdpi"| xxd -r - "$f"
done

Note that some jpegs are in EXIF format which is different and requires parsing to change. This script has now been fixed to properly handle filenames that contain spaces (it will not process files beginning with a hyphen, and very few unix programs will). It has also been fixed to check that the new DPI has been specified, and that the file really is in JFIF 1.00 to 1.02 format.
« Last Edit: November 10, 2017, 07:43:22 pm by helius »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1840
  • Country: 00
Re: Why does DPI Matter?
« Reply #9 on: November 09, 2017, 06:50:23 pm »
exiftool seems like a good tool all around.

I am struggling with the syntax

exiftool.exe filename.jpg -[EXIF:]"X Resolution"=96

helius, is that a batch file?

There are thousands of files in a deep directory structure of tiff, jpg, png, and psd.

BTW, I found photoshop's processor and ran a batch process on a folder. The problem seems to be that I have to select a target file type and that will convert the files to the destination type (i.e., jpg to tiff)
« Last Edit: November 09, 2017, 06:52:55 pm by metrologist »
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3015
  • Country: us
Re: Why does DPI Matter?
« Reply #10 on: November 09, 2017, 06:59:30 pm »
I am struggling with the syntax
exiftool.exe filename.jpg -[EXIF:]"X Resolution"=96
See http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=2164.0

Quote
helius, is that a batch file?
There are thousands of files in a deep directory structure of tiff, jpg, png, and psd.
So you can iterate over files in a directory structure using the 'find' command. You would need different tools to change those different file formats. Photoshop actions are rather limited in scripting ability, but (at least in CC) Photoshop also supports Javascript command files. I'm sorry that I don't have any experience with that.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1840
  • Country: 00
Re: Why does DPI Matter?
« Reply #11 on: November 09, 2017, 07:07:08 pm »
This worked:

exiftool.exe rap-2.png -XResolution=300 -YResolution=300

And I can use a batch file to write the path/filename of every file to a text file, then use Excel to append the required text as above, and paste that into a batch file, and run it before I leave today, and several thousand files should be ready in the morning. I will extend the batch process to move the originals to a backup location.

That is awesome!
 

Offline jm_araujo

  • Regular Contributor
  • *
  • Posts: 62
  • Country: pt
Re: Why does DPI Matter?
« Reply #12 on: November 09, 2017, 08:04:10 pm »
"DPI is only meaningful in the physical world" is an unfortunate assumption, much like "640K will be enough for everybody". It has held back scalable user interfaces for decades.

Probably could have word it better. By physical I meant printed or in a display or other means in the "real" world.
A 300x300 pixel picture will have the same information regardless of the DPI chosen. Only it's size in the "real" world changes with the DPI (including scalable user interfaces).
 
The following users thanked this post: helius

Offline tooki

  • Super Contributor
  • ***
  • Posts: 5249
  • Country: ch
Re: Why does DPI Matter?
« Reply #13 on: November 09, 2017, 10:23:56 pm »
One marketing person to another is requesting all images be set to 300dpi. Marketing person comes to me and asks if Paint can do that!

I contend there is no need for 300dpi setting as that only applies to print, and would depend on how the image gets processed. Sure, you want to print 300dpi, I say, but it is important that you have enough pixels to print the size that you want. So, the number of pixels will tell the max size you can print at a particular resolution.

I say the dpi setting in the file is merely semantic metadata and how it's used depends on the application processing the image. For example, Paint is not going to care if the image is set to 72, 96, or 300dpi, it will look the same... amiright?

Anyway, to appease their request, is anyone familiar with how to set up a batch process and application that can change this little piece of data in tiff, png, and jpeg images? I have the Adobe suite (photoshop and bridge).
Ah yes, the cargo-cult requirement of 300dpi, dragged along from the early days of desktop publishing in the prepress world. (That was the industry I cut my teeth on when I was a young whippersnapper computer tech.)

Yes, you're absolutely correct that in a digital file, the DPI is pure metadata. It's up to the application to decide how to use it, or to ignore it.

As others have said, if the recipient doesn't understand DPI (and let's face it, most marketing/advertising folks don't), you have no chance of convincing them otherwise.

You said you've got Photoshop. Then you can easily change the DPI. Open the file, go to Image > Image Size. Make sure the Resample checkbox is not selected. In the Resolution field, set the unit to pixels/inch and then enter 300. Click OK and save the image, done!

This process is shown (in lavish detail) in the second video here: https://helpx.adobe.com/photoshop/how-to/image-resizing-basics.html

Now, that's the manual process. For a batch, you'll just create a droplet, following these instructions, but using the exact settings above in the Image Size dialog: http://uozdesign.com/make-your-first-photoshop-resize-droplet

Hope this helps!
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 5249
  • Country: ch
Re: Why does DPI Matter?
« Reply #14 on: November 09, 2017, 10:26:45 pm »
I think there is a reason for the marketing guy to request 300dpi images even for web material, as those images would look nicer on a device with high DPI display (like recent iPhones, or people with 4K monitors - I have both, and it does make a difference.)
Nah, it's a holdover from the print era, plain and simple. :(
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1840
  • Country: 00
Re: Why does DPI Matter?
« Reply #15 on: November 09, 2017, 11:43:37 pm »
You said you've got Photoshop. Then you can easily change the DPI. Open the file, go to Image > Image Size. Make sure the Resample checkbox is not selected. In the Resolution field, set the unit to pixels/inch and then enter 300. Click OK and save the image, done!

This process is shown (in lavish detail) in the second video here: https://helpx.adobe.com/photoshop/how-to/image-resizing-basics.html

Now, that's the manual process. For a batch, you'll just create a droplet, following these instructions, but using the exact settings above in the Image Size dialog: http://uozdesign.com/make-your-first-photoshop-resize-droplet

Hope this helps!

Thanks, Tooki. There are ~45,000 images. Many will already be the right DPI, but no time to figure that out.
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3321
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Why does DPI Matter?
« Reply #16 on: November 09, 2017, 11:45:30 pm »
I think there is a reason for the marketing guy to request 300dpi images even for web material, as those images would look nicer on a device with high DPI display (like recent iPhones, or people with 4K monitors - I have both, and it does make a difference.)
Nah, it's a holdover from the print era, plain and simple. :(
The pixels on those HiDPI monitors are so small that pixel-for-pixel display of traditional user interface would be too small to read or use. So for those HiDPI monitors either they have to prepare a vector image or higher DPI image to display pixel for pixel, or allow the image scaling algorithm to ruin the entire user interface. HiDPI sort of forced some print era solutions to resurface, as the screens now have similar dpi resolution as the printers.
 

Offline rsfoto

  • Contributor
  • Posts: 15
  • Country: mx
Re: Why does DPI Matter?
« Reply #17 on: November 10, 2017, 12:00:45 am »
Hi Guys,

Looks like there is a lot of confusion here in regard to dpi and printing.

Lets take an image of 330 pixels wide and 300 pixels high ¿ OK ? and look at this image on the monitor. 300x300 pixels on a monitor will always be 300x300 pixels and here it does not matter what dpi setting you have.

Make a test ina a image processing software and specify 300dpi and specify 1 dpi or 10, some programs do not allow 1 dpi but it does not matter and now view each image on your montior. Both will have the same size on you monitor.

Now take that same image and send it to a rpinter and you will be surprised :-)

The image with 300dpi will print 1" x 1" and the image specified with 10 dpi will print 30" x 30" ... as the abbreviation says DPI = dots per inch and in this case 1 dot is 1 pixel ... so the printer will take the image with 330dpi and use 300 pixels for printing 1" and the image with 10dpi the printer will take 10pixels to fill one inch ...

300dpi es equal each dot has a size of 25.4mm / 300 is equal the dot size = 0.0847mm and in the case of 10dpi the printed dot size will be 25.4mm / 10 and so each printed dot = pixel wirtl have a size of 2.54mm

regards Rainer
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 5249
  • Country: ch
Re: Why does DPI Matter?
« Reply #18 on: November 10, 2017, 12:12:51 am »
I think there is a reason for the marketing guy to request 300dpi images even for web material, as those images would look nicer on a device with high DPI display (like recent iPhones, or people with 4K monitors - I have both, and it does make a difference.)
Nah, it's a holdover from the print era, plain and simple. :(
The pixels on those HiDPI monitors are so small that pixel-for-pixel display of traditional user interface would be too small to read or use. So for those HiDPI monitors either they have to prepare a vector image or higher DPI image to display pixel for pixel, or allow the image scaling algorithm to ruin the entire user interface. HiDPI sort of forced some print era solutions to resurface, as the screens now have similar dpi resolution as the printers.
We aren't talking about user interfaces. We're talking about marketing photos.

Hi Guys,

Looks like there is a lot of confusion here in regard to dpi and printing.

Lets take an image of 330 pixels wide and 300 pixels high ¿ OK ? and look at this image on the monitor. 300x300 pixels on a monitor will always be 300x300 pixels and here it does not matter what dpi setting you have.

Make a test ina a image processing software and specify 300dpi and specify 1 dpi or 10, some programs do not allow 1 dpi but it does not matter and now view each image on your montior. Both will have the same size on you monitor.

Now take that same image and send it to a rpinter and you will be surprised :-)
[snip]
Well, you mean setting the printer to output at 300dpi. Indeed, grainy as f••k.

Anyway, ah yes, the classic confusion of PPI and DPI. (For those who don't know, PPI [pixels per inch] refers to the "logical" pixels in a digital image. DPI [dots per inch] refers to the physical dots in an output device used to create said pixels.) But yeah, DPI is what everyone uses to refer to both, and here, I chose to just go with it. ;)



For historical context, the 300ppi rule of thumb for photos (at the final output size, which marketing weenies don't understand) was basically because that's a good, sufficiently high resolution for the photos to exhibit no jaggies when sending them for offset printing at 2450dpi. (For line art, you really wanted scans at 1200ppi at the final output size, assuming you didn't have access to vector graphics.) Generally, for photos, you want the photo's PPI to be at least 1/10 of the DPI of the printer. So for 2450dpi offset, 245ppi would be enough, so 300ppi gives you an added margin of error. Some types of dithering (like the scatter dithering normally used on inkjets, but occasionally on offset as well) allow for greater sharpness, and so those can benefit a bit from even higher PPIs in the photos.
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3015
  • Country: us
Re: Why does DPI Matter?
« Reply #19 on: November 10, 2017, 03:34:55 am »
The point about halftone screens for offset lithography is valid (but it is really the color separations that are sent for plate making, not color photos themselves), but 300 dpi was the most common resolution for continuous tone printers (dye sublimation and solid wax types, as well as lightjet/lambda). In continuous tone no dithering is required, and pixels in the image correspond exactly to dots on the paper.
« Last Edit: November 10, 2017, 03:37:23 am by helius »
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 10099
  • Country: au
Re: Why does DPI Matter?
« Reply #20 on: November 10, 2017, 03:51:18 am »
This summed up everything useful from this thread for me...

Well, you mean setting the printer to output at 300dpi. Indeed, grainy as f••k.

Anyway, ah yes, the classic confusion of PPI and DPI. (For those who don't know, PPI [pixels per inch] refers to the "logical" pixels in a digital image. DPI [dots per inch] refers to the physical dots in an output device used to create said pixels.) But yeah, DPI is what everyone uses to refer to both, and here, I chose to just go with it. ;)



For historical context, the 300ppi rule of thumb for photos (at the final output size, which marketing weenies don't understand) was basically because that's a good, sufficiently high resolution for the photos to exhibit no jaggies when sending them for offset printing at 2450dpi. (For line art, you really wanted scans at 1200ppi at the final output size, assuming you didn't have access to vector graphics.) Generally, for photos, you want the photo's PPI to be at least 1/10 of the DPI of the printer. So for 2450dpi offset, 245ppi would be enough, so 300ppi gives you an added margin of error. Some types of dithering (like the scatter dithering normally used on inkjets, but occasionally on offset as well) allow for greater sharpness, and so those can benefit a bit from even higher PPIs in the photos.
 
The following users thanked this post: tooki

Offline tooki

  • Super Contributor
  • ***
  • Posts: 5249
  • Country: ch
Re: Why does DPI Matter?
« Reply #21 on: November 10, 2017, 11:37:02 am »
The point about halftone screens for offset lithography is valid (but it is really the color separations that are sent for plate making, not color photos themselves), but 300 dpi was the most common resolution for continuous tone printers (dye sublimation and solid wax types, as well as lightjet/lambda). In continuous tone no dithering is required, and pixels in the image correspond exactly to dots on the paper.
Well yes, color separations are what make the plates, but that's neither here nor there. The graphic designer may or may not be involved in making the separations. Often, they send the raw DTP files (Quark, InDesign, etc) to the print house, who then does the prepress themselves. (Today, designers often send PDFs, though they're special PDFs specifically for prepress.) So from the designer's perspective, they just have to make sure that the photos are at rock bottom minimum 240ppi at final output size. How it makes it to the paper isn't really their concern. (Every color printer makes a color separation at some point in the process, it's just normally never seen.)

I don't think the 300dpi resolution of dye-sub printers and lightjet photo printers is the reason for 300ppi becoming a standard, though. Compared to prepress, those prints were kinda obscure, and the continuous-tone nature of their output would smooth the edges of a scaled image anyway, within reason. (Solid wax and wax thermal transfer are not continuous tone, btw.)
 

Offline Tom45

  • Frequent Contributor
  • **
  • Posts: 431
  • Country: us
Re: Why does DPI Matter?
« Reply #22 on: November 10, 2017, 03:41:36 pm »
Here are two versions of the same photo shown side by side: one is 300 ppi, and the other is 10 ppi.

10 ppi on the left, 300 ppi on the right


The individual files are below.
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3321
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Why does DPI Matter?
« Reply #23 on: November 10, 2017, 04:34:28 pm »
I think there is a reason for the marketing guy to request 300dpi images even for web material, as those images would look nicer on a device with high DPI display (like recent iPhones, or people with 4K monitors - I have both, and it does make a difference.)
Nah, it's a holdover from the print era, plain and simple. :(
The pixels on those HiDPI monitors are so small that pixel-for-pixel display of traditional user interface would be too small to read or use. So for those HiDPI monitors either they have to prepare a vector image or higher DPI image to display pixel for pixel, or allow the image scaling algorithm to ruin the entire user interface. HiDPI sort of forced some print era solutions to resurface, as the screens now have similar dpi resolution as the printers.
We aren't talking about user interfaces. We're talking about marketing photos.
The same still stands. Showing a 96ppi image on a 162dpi screen (iPhone 3GS) is okay, but on a 364dpi acreen (iPhone 4 and up) it looks like crap due to either being to small when shown pixel for pixel, or blurriness or jaggedness from pixel doubling. The same for a 85dpi 1080p monitor versus a 170dpi 4K monitor. Using high enough ppi source image allow the browsers on standard monitors to scale the picture down while HiDPI browsers still have enough information to reproduce a crisp smooth HiDPI image.
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3015
  • Country: us
Re: Why does DPI Matter?
« Reply #24 on: November 10, 2017, 05:02:55 pm »
We aren't talking about user interfaces. We're talking about marketing photos.
The same still stands. Showing a 96ppi image on a 162dpi screen (iPhone 3GS) is okay, but on a 364dpi acreen (iPhone 4 and up) it looks like crap due to either being to small when shown pixel for pixel, or blurriness or jaggedness from pixel doubling. The same for a 85dpi 1080p monitor versus a 170dpi 4K monitor. Using high enough ppi source image allow the browsers on standard monitors to scale the picture down while HiDPI browsers still have enough information to reproduce a crisp smooth HiDPI image.
The point here is that when you display a user interface on a phone, the display size and position are fixed for all time (it must fill the screen). This means that the image file is known to correspond to the physical dimensions of the phone's screen. For this reason, developers supply different user interface files for phones and tablets, and different files for HiDPI phones. Changing the ppi tag in the JFIF or EXIF file would not solve this problem.
On computers the image is not displayed at a fixed size or position. If the image is opened in its own window, most software defaults to displaying it at 100% (each pixel of the image corresponding to a pixel of the display*), unless the image is too large to fit the window, in which case it gets scaled down to fit. If the image is part of a web page, it is displayed in a box chosen by the page render algorithm, which takes information from the HTML and CSS tags, not the ppi tag in the file.
In all these cases, the ppi tag does not affect what happens on the monitor. Tom45's post shows this clearly.

However, there is one case where I know for certain that the ppi tag matters in a computer, not just in a printer driver. When you place an image into a document using Illustrator or Quark, the software reads the ppi from the image (or the physical dimension tags if it is EXIF) and uses it to choose the size of the bounding rectangle. This can be changed easily by the user, but by default they will assume the ppi tags are correct.

* (Some computers treat "100%" differently on high-resolution screens as part of their UI scaling protocol.)
 
The following users thanked this post: tooki


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf