Why does DPI Matter? - Page 1
Forum section: electronics / general

author: metrologist
author_rank: Super Contributor
timestamp: November 09, 2017, 04:41:35 pm
content: 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).

author: jm_araujo
author_rank: Regular Contributor
timestamp: November 09, 2017, 04:47:05 pm
content: 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.

author: IanB
author_rank: Super Contributor
timestamp: November 09, 2017, 04:49:37 pm
content: They probably mean that images should beat least300 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.

author: Tom45
author_rank: Frequent Contributor
timestamp: November 09, 2017, 05:09:55 pm
content: 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.

author: metrologist
author_rank: Super Contributor
timestamp: November 09, 2017, 05:14:57 pm
content: 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.

author: helius
author_rank: Super Contributor
timestamp: November 09, 2017, 05:23:18 pm
content: 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.

author: Peabody
author_rank: Super Contributor
timestamp: November 09, 2017, 05:43:56 pm
content: 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 4800 48Those 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 2C01 2CBe 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.

author: technix
author_rank: Super Contributor
timestamp: November 09, 2017, 06:23:39 pm
content: 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.

author: helius
author_rank: Super Contributor
timestamp: November 09, 2017, 06:24:46 pm
content: Code:#!/bin/bashprogram=`basename $0`while (( $# > 0 )); docase "$1" in--help|-h)echo "Changes the dpi setting of a JFIF file or files."echo "usage: $program --dpi  file1 file2 ... fileN"exit 0;;--dpi)dpi=$2shift;;-*)echo "$program: $1: unknown option"exit 1;;*)args+=("$1")esacshiftdoneprintf -v xdpi "%.4x" ${dpi:?DPI unspecified}for f in "${args[@]}"; do[[ `xxd -p -l14 "$f"` =~ ffd8ffe0[0-9a-f]{4}4a464946000100 ]] && \echo "000000d: 01 $xdpi $xdpi"| xxd -r - "$f"doneNote 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.

author: metrologist
author_rank: Super Contributor
timestamp: November 09, 2017, 06:50:23 pm
content: exiftool seems like a good tool all around.I am struggling with the syntaxexiftool.exe filename.jpg -[EXIF:]"X Resolution"=96helius, 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)

author: helius
author_rank: Super Contributor
timestamp: November 09, 2017, 06:59:30 pm
content: Quote from: metrologist on November 09, 2017, 06:50:23 pmSeehttp://u88.n24.queensu.ca/exiftool/forum/index.php?topic=2164.0QuoteSo 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.

author: metrologist
author_rank: Super Contributor
timestamp: November 09, 2017, 07:07:08 pm
content: This worked:exiftool.exe rap-2.png -XResolution=300 -YResolution=300And 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!

author: jm_araujo
author_rank: Regular Contributor
timestamp: November 09, 2017, 08:04:10 pm
content: Quote from: helius on November 09, 2017, 05:23:18 pmProbably 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).

author: tooki
author_rank: Super Contributor
timestamp: November 09, 2017, 10:23:56 pm
content: Quote from: metrologist on November 09, 2017, 04:41:35 pmAh yes, thecargo-cultrequirement 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 toImage > Image Size. Make sure theResamplecheckbox isnot selected. In theResolutionfield, set the unit topixels/inchand then enter300. ClickOKand 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.htmlNow, 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-dropletHope this helps!

author: tooki
author_rank: Super Contributor
timestamp: November 09, 2017, 10:26:45 pm
content: Quote from: technix on November 09, 2017, 06:23:39 pmNah, it's a holdover from the print era, plain and simple.

author: metrologist
author_rank: Super Contributor
timestamp: November 09, 2017, 11:43:37 pm
content: Quote from: tooki on November 09, 2017, 10:23:56 pmThanks, Tooki. There are ~45,000 images. Many will already be the right DPI, but no time to figure that out.

author: technix
author_rank: Super Contributor
timestamp: November 09, 2017, 11:45:30 pm
content: Quote from: tooki on November 09, 2017, 10:26:45 pmThe 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.

author: rsfoto
author_rank: Contributor
timestamp: November 10, 2017, 12:00:45 am
content: 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.54mmregards Rainer

author: tooki
author_rank: Super Contributor
timestamp: November 10, 2017, 12:12:51 am
content: Quote from: technix on November 09, 2017, 11:45:30 pmWe aren't talking about user interfaces. We're talking about marketing photos.Quote from: rsfoto on November 10, 2017, 12:00:45 amWell, 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 thefinal 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.

author: helius
author_rank: Super Contributor
timestamp: November 10, 2017, 03:34:55 am
content: 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.

author: Brumby
author_rank: Unknown
timestamp: November 10, 2017, 03:51:18 am
content: This summed up everything useful from this thread for me...Quote from: tooki on November 10, 2017, 12:12:51 am

author: tooki
author_rank: Super Contributor
timestamp: November 10, 2017, 11:37:02 am
content: Quote from: helius on November 10, 2017, 03:34:55 amWell 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.)

author: Tom45
author_rank: Frequent Contributor
timestamp: November 10, 2017, 03:41:36 pm
content: 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 rightThe individual files are below.

author: technix
author_rank: Super Contributor
timestamp: November 10, 2017, 04:34:28 pm
content: Quote from: tooki on November 10, 2017, 12:12:51 amThe 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.

author: helius
author_rank: Super Contributor
timestamp: November 10, 2017, 05:02:55 pm
content: Quote from: technix on November 10, 2017, 04:34:28 pmThe 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.)

author: metrologist
author_rank: Super Contributor
timestamp: November 10, 2017, 05:49:49 pm
content: Most of the images we are looking at are untreated JPEG images from photoshoots - what comes out of the camera. It's basically a photo archive, but there are also many derivative compilations, not generally considered a final deliverable for any sort of publication.The marketing folks would be going here to get source images for use in web media, PDF, and other...I think it is a silly request.

author: rsfoto
author_rank: Contributor
timestamp: November 10, 2017, 09:34:21 pm
content: Quote from: Tom45 on November 10, 2017, 03:41:36 pmThat is not right as you are comparing apples and oranges.OK, what you did is resize that crop to a different size in PPI and then resized it again and so of course it looses resolution ...You can see that in your 2 images which have a completely different size.regards Rainer

author: tooki
author_rank: Super Contributor
timestamp: November 10, 2017, 10:52:52 pm
content: Quote from: Tom45 on November 10, 2017, 03:41:36 pmYou didn’t understand the original query. He wasn’t asking about scaling an image. It’s only about the resolution metadata tag in a file. Cute capybara, though!Quote from: technix on November 10, 2017, 04:34:28 pmWho cares? This still has nothing to do with the discussion at hand!!

author: Tom45
author_rank: Frequent Contributor
timestamp: November 11, 2017, 12:27:22 am
content: Quote from: tooki on November 10, 2017, 10:52:52 pmThe original query was in effect, does the dpi setting mean anything?Quote from: metrologist on November 09, 2017, 04:41:35 pmAnd then others said that a larger dpi(ppi) is better than a smaller value.My example was to show that the number of pixels is what is important in determining the image quality, not the dpi setting in the file's metadata.Tom

author: tooki
author_rank: Super Contributor
timestamp: November 11, 2017, 12:45:22 am
content: Quote from: Tom45 on November 11, 2017, 12:27:22 amAgain, I think you misunderstood the query. We all know that the pixel count is what actually provides detail. The question was about what the DPI setting (i.e. the metadata tag) does, and the fact is, that’s app-dependent, and marketing weenies don’t understand it.I don’t see where anyone said that a higher DPI is better. Without a specific context, such a statement is meaningless anyway.