I'm trying to find out the DPI of an image using the Pillow module.
I'm doing this
image = Image.open("image.jpeg")
print(image.info["dpi"])
which returns
(300, 300)
Why is this a tuple? I was expecting a single value. What do the two values relate to and which should I use to give me the same value I see in photoshop?
The docs do not say much about this, but I've gone roughly through source code and it seems that this refers to DPI in x and y axis (look at search results)
Especially this suggests that there could exist something as non-square pixels.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With