<p>They are not "very similar images". They have quite different aspect ratios. The first one has a 5:6 aspect ratio, while the other has a 3:4 ratio.</p>

<p>If you try to print a 5:6 image at 8x10, what you find is that if the width is 8, then a 5:6 image would have a height of 9.6, which is less than 10. So that means the 5:6 image can fit into the 8x10 region with its full width; some of the height will go unused.</p>

<p>However, a 3:4 aspect ratio image at 8x10 doesn't do that. If the width is 8, then the 3:4 aspect ratio would require a height of 10.6. That would exceed the maximum available height, so the width cannot be full width. Instead, it uses the full height of 10, and the width used will only be 7.5.</p>

<p>You will find that this is the case for all of the ones where you noted such a difference.</p>

<p>The "DPI" its computing is essentially the number of pixels in the dimension that <em>isn't</em> the maximum. For the 3:4 image at 8x10, it takes the image width (1000) and divides by the area width (8). For the 5:6 image at 8x10, it takes the image height (1200) and divided by the area height (10).</p>

<p>This number only makes sense if we assume that the image is being scaled independently in width and height to fit the page. That is, the aspect ratio of the image is not being preserved when printed. So a 5:6 image is being transformed into a 4:5 aspect ratio image when printed at 8x10.</p>

<p>Since each dimension is being scaled differently, each dimension has its own DPI. The lowest DPI will be for the dimension being stretched the most. And that's what this formula seems to be computing.</p>

<p>Of course... <em>who cares?</em> Stretching images creates obvious visual distortion, and should pretty much never be done when printing something you actually want to have a paper copy of. So I would declare this computation algorithm to be bogus and move to something that actually makes sense with a reasonable printing methodology.</p>

CC BY-SA 3.0
2017-03-07T22:27:35.540Z
One more question - how did you count aspect ratio of these images?
funguy
CC BY-SA 3.0
2017-03-11T17:59:30.180Z
For real, @Nicol Bolas, how did you determine that 1000x1333 image has aspect ratio of 3:4? Even this site https://www.ninjaunits.com/calculators/aspect-ratio/ does not determine this.
funguy
CC BY-SA 3.0
2017-03-11T18:04:59.343Z
@funguy: The aspect ratio of an image is the ratio of the image's width to its height. You don't need a website to divide 1000 by 1333; you only need a calculator. Note that this ratio is just the ratio of the image itself; some image formats have metadata that specify what aspect ratio the image should be *stretched* to in order to correctly reproduce what it stores. But absent such metadata, the assumption is that the ratio of the pixels is how the image should be displayed.
Nicol Bolas
CC BY-SA 3.0
2017-03-11T19:26:40.317Z
Yes, @Nicol Bolas, but this is what I want to understand, how to find out aspect ratio with a calculator. If you divide 1000/1333 you will get something like 0.75018... but still, how to add up this final result - 3x4?
funguy
CC BY-SA 3.0
2017-03-07T06:10:11.150Z
2017-03-07T06:10:11.150Z
Nicol Bolas
<p>a) I have used an online service where you can upload an image.</p>

<p>b) Afterwards, you can select a print size and it gives you information on what is actual DPI based on that print size.</p>

<p>c) When it gives you information if that particular DPI (dots per inch) for that print size is enough quality to print, so basically it outputs "bad", "average" or "good".</p>

<p>I want to built this functionality on my own site, but I lack logic's behind how they count DPI.</p>

<p>This is my two tests where I upload slightly different photos. As site outputs DPI it is easy to try to get how it counts it, but as for different photos it does differently. I just can not grasp the pattern on why it does so.</p>

<p>Here is my two different photos uploaded:</p>

<p>Product: Poster
Size: 1000x1200</p>

<p>I will just explain the first value - 8x10 -> 1200 / 10  -  you get DPI by subtracting photo height with print size height.</p>

<pre><code>8x10 -&gt; 1200 / 10   -&gt;&gt;&gt; why this DPI is counted differently from other image?     
10x10 -&gt; 1000 / 10                
12x12 -&gt; 1000 / 12               
12x16 -&gt; 1200 / 16  -&gt;&gt;&gt; why this DPI is counted differently from other image?     
14x14 -&gt; 1000 / 14                
16x16 -&gt; 1000 / 16                
12x18 -&gt; 1200 / 18                
18x18 -&gt; 1000 / 18                
16x20 -&gt; 1200 / 20  -&gt;&gt;&gt; why this DPI is counted differently from other image?     
18x24 -&gt; 1200 / 24  -&gt;&gt;&gt; why this DPI is counted differently from other image?     
24x36 -&gt; 1200 / 36   
</code></pre>

<p>Product: Poster
Size: 1000x1333</p>

<pre><code>8x10 -&gt; 1000 / 8    -&gt;&gt;&gt; comparing to this value 
10x10 -&gt; 1000 / 10
12x12 -&gt; 1000 / 12
12x16 -&gt; 1000 / 12  -&gt;&gt;&gt; comparing to this value   
14x14 -&gt; 1000 / 14
16x16 -&gt; 1000 / 16
12x18 -&gt; 1333 / 18                   
18x18 -&gt; 1000 / 18
16x20 -&gt; 1000 / 20  -&gt;&gt;&gt; comparing to this value 
18x24 -&gt; 1000 / 18  -&gt;&gt;&gt; comparing to this value 
24x36 -&gt; 1333 / 36    
</code></pre>

<p>Just do not get it why for a very similar image, counting of the same print sizes are different for particular values?</p>

<p>Any ideas?</p>

CC BY-SA 3.0
2017-03-07T05:39:43.930Z
Usually the printer will tell you the minimum DPI required. I believe that most printers use 300 DPI for printing photos. They may let you get away with less (hence the bad and average categories), but their hardware prints at 300 dpi so your image should have enough pixels for that.
user1118321
CC BY-SA 3.0
2017-03-08T20:53:03.950Z
Keep in mind that those suggestions are mostly useless. You won't see anywhere near 300 DPI from common commercial printers on typical photo paper. It's closer to 100-150 DPI in my experience. And you won't be able to see even that much on larger prints from a reasonable viewing distance so you can get away with less.
Olivier
<image-processing>
How to count DPI of an image (challenge)?
funguy
# How to count DPI of an image (challenge)?

(Asked by: username_0 on 2017-03-06)

a) I have used an online service where you can upload an image.

b) Afterwards, you can select a print size and it gives you information on what is actual DPI based on that print size.

c) When it gives you information if that particular DPI (dots per inch) for that print size is enough quality to print, so basically it outputs "bad", "average" or "good".

I want to built this functionality on my own site, but I lack logic's behind how they count DPI.

This is my two tests where I upload slightly different photos. As site outputs DPI it is easy to try to get how it counts it, but as for different photos it does differently. I just can not grasp the pattern on why it does so.

Here is my two different photos uploaded:

Product: Poster
Size: 1000x1200

I will just explain the first value - 8x10 -> 1200 / 10 - you get DPI by subtracting photo height with print size height.

```
8x10 -> 1200 / 10   ->>> why this DPI is counted differently from other image?     
10x10 -> 1000 / 10                
12x12 -> 1000 / 12               
12x16 -> 1200 / 16  ->>> why this DPI is counted differently from other image?     
14x14 -> 1000 / 14                
16x16 -> 1000 / 16                
12x18 -> 1200 / 18                
18x18 -> 1000 / 18                
16x20 -> 1200 / 20  ->>> why this DPI is counted differently from other image?     
18x24 -> 1200 / 24  ->>> why this DPI is counted differently from other image?     
24x36 -> 1200 / 36   

```

Product: Poster
Size: 1000x1333

```
8x10 -> 1000 / 8    ->>> comparing to this value 
10x10 -> 1000 / 10
12x12 -> 1000 / 12
12x16 -> 1000 / 12  ->>> comparing to this value   
14x14 -> 1000 / 14
16x16 -> 1000 / 16
12x18 -> 1333 / 18                   
18x18 -> 1000 / 18
16x20 -> 1000 / 20  ->>> comparing to this value 
18x24 -> 1000 / 18  ->>> comparing to this value 
24x36 -> 1333 / 36    

```

Just do not get it why for a very similar image, counting of the same print sizes are different for particular values?

Any ideas?

**Tags:** image-processing

> **Comments:**
> **username_1**: Usually the printer will tell you the minimum DPI required. I believe that most printers use 300 DPI for printing photos. They may let you get away with less (hence the bad and average categories), but their hardware prints at 300 dpi so your image should have enough pixels for that.  
> **username_2**: Keep in mind that those suggestions are mostly useless. You won't see anywhere near 300 DPI from common commercial printers on typical photo paper. It's closer to 100-150 DPI in my experience. And you won't be able to see even that much on larger prints from a reasonable viewing distance so you can get away with less.  

---

## 1 answers

### Answer by username_3 on 2017-03-07. Score: 3 | Accepted answer

They are not "very similar images". They have quite different aspect ratios. The first one has a 5:6 aspect ratio, while the other has a 3:4 ratio.

If you try to print a 5:6 image at 8x10, what you find is that if the width is 8, then a 5:6 image would have a height of 9.6, which is less than 10. So that means the 5:6 image can fit into the 8x10 region with its full width; some of the height will go unused.

However, a 3:4 aspect ratio image at 8x10 doesn't do that. If the width is 8, then the 3:4 aspect ratio would require a height of 10.6. That would exceed the maximum available height, so the width cannot be full width. Instead, it uses the full height of 10, and the width used will only be 7.5.

You will find that this is the case for all of the ones where you noted such a difference.

The "DPI" its computing is essentially the number of pixels in the dimension that *isn't* the maximum. For the 3:4 image at 8x10, it takes the image width (1000) and divides by the area width (8). For the 5:6 image at 8x10, it takes the image height (1200) and divided by the area height (10).

This number only makes sense if we assume that the image is being scaled independently in width and height to fit the page. That is, the aspect ratio of the image is not being preserved when printed. So a 5:6 image is being transformed into a 4:5 aspect ratio image when printed at 8x10.

Since each dimension is being scaled differently, each dimension has its own DPI. The lowest DPI will be for the dimension being stretched the most. And that's what this formula seems to be computing.

Of course... *who cares?* Stretching images creates obvious visual distortion, and should pretty much never be done when printing something you actually want to have a paper copy of. So I would declare this computation algorithm to be bogus and move to something that actually makes sense with a reasonable printing methodology.

> **Comments:**
> **username_0**: One more question - how did you count aspect ratio of these images?  
> **username_0**: For real, @username_3, how did you determine that 1000x1333 image has aspect ratio of 3:4? Even this site https://www.ninjaunits.com/calculators/aspect-ratio/ does not determine this.  
> **username_3**: @username_0: The aspect ratio of an image is the ratio of the image's width to its height. You don't need a website to divide 1000 by 1333; you only need a calculator. Note that this ratio is just the ratio of the image itself; some image formats have metadata that specify what aspect ratio the image should be *stretched* to in order to correctly reproduce what it stores. But absent such metadata, the assumption is that the ratio of the pixels is how the image should be displayed.  
> **username_0**: Yes, @username_3, but this is what I want to understand, how to find out aspect ratio with a calculator. If you divide 1000/1333 you will get something like 0.75018... but still, how to add up this final result - 3x4?  

---

