0

I've been searching all day for a way to get the physical dimension from a PNG image.I need to convert a PNG file into a numpy array, which is easy.

However, I cannot find a way to get the physical dimension of each pixel in the same image. Additionally, I need the origin of the image (i.e. the coordinate)

I understand that the physical dimension of a pixel is stored on a PNG image on the pHYs as part of the metadata. So I attempted to get all the metadata by following these steps: In Python, how do I read the exif data for an image?

However, the ._getifex() is not an actual method in the current version.

Community
  • 1
  • 1
synkilla12
  • 43
  • 5
  • 1
    I don't understand what "physical dimensions" of a png should be. You only have physical dimensions when you know your dpi resolution or when you exactly know about imaging conditions of the device the image was taken with. Please edit your question, providing more background. (Google doesn't know "pHYs") – jkalden Nov 22 '15 at 09:23
  • pHYs isn't part of EXIF data; it's a separate PNG chunk. The image origen is stored in another chunk, "oFFs". You can use the commandline app "pngcheck -v" to see the pHYs and oFFs chunks, if they are present. – Glenn Randers-Pehrson Nov 22 '15 at 15:38
  • 3
    For information about the `pHYs` chunk, see http://www.w3.org/TR/PNG/#11pHYs. The `oFFs` chunk is an extension of the PNG format; see, for example, http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.div.10 – Warren Weckesser Nov 22 '15 at 19:44

0 Answers0