Pixmap.save Unable to save pNG format correctly #2869
-
I used python to write a pdf format invoice into a png image program, found that the new version of PyMuPDF Pixmap.save () save the png format may appear to stamp opaque problem, try to use 1.20.0 before the version of the library, use Pixmap.writePNG () save is normal, I would like to ask about the new I would like to ask the new version there are other methods equivalent to Pixmap.writePNG command to achieve the same function? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
You are referring to method names that have been changed a long time ago now. Saving to memory is now called |
Beta Was this translation helpful? Give feedback.
-
Cannot reproduce. The following snippet works exactly as it should: doc=fitz.open("default.pdf")
page=doc[0]
pix=page.get_pixmap(matrix=fitz.Matrix(3,3),alpha=True)
pix.save("test.png")
fitz.__version__
'1.23.7' |
Beta Was this translation helpful? Give feedback.
-
这个问题是不是还没有在新版本中修正,因为我尝试使用1.23.8及以后的版本,依然存在这个问题,能确认一下吗 |
Beta Was this translation helpful? Give feedback.
Well best would be everything that you haven't mentioned yet, notably operating system and PyMuPDF installation method.Found the problem:
It is connected with an issue in the base library MuPDF. My local PyMuPDF version already uses the current, corrected MuPDF, therefore I am able to produce correct images.
So you will have to wait with your upgrade until PyMuPDF v1.23.8 comes out.