PyMuPDF issue https://github.com/pymupdf/PyMuPDF/issues/4433 Example file https://media3.bosch-home.com/Documents/specsheet/nl-NL/WGG246Z5NL.pdf All images returned by the stext device have image->xres = 96 and image->yres = 96 although, when the image is saved with the corresponding extension, other resolutions are reported - e.g. JPEGs extracted via mutool also have x/y resolutions 299.
All images in PDF are created with 96dpi as their default xres/yres. This is because this value makes no difference to how they are used within a PDF file. Many PDF images don't have any actual xres/yres values to read (for instance raw/LZW/Zlib compressed ones). Other formats (such as JPEGs) do have xres/yres values, but to get them, we'd need to decode the format, and we delay doing that for as long as possible. It's important to understand why the user might want these values. If they want to know the xres/yres of the raw images used within a PDF file, then decode to a pixmap and interrogate that. But those values will not be related to how the images are actually used. Consider a single image in a PDF may be used repeatedly on one (or many) pages at different scales. The interesting thing is then what the effective resolution is for each instance of that image. And that can only be calculated by looking at how each usage of the the image is used. This can be done from the data in the stext blocks (transform and image w/h). As such, I don't think there is anything we can change in MuPDF to improve things.