How to make transparent background white instead of black when converting PDF to JPG using PythonMagick
问题 I'm trying to convert from PDF to JPG using PythonMagick, but I can't find a way to set the background color, which by default is changed from transparent to black. I can get the desired result using os.system and the -flatten parameter as shown below. import os os.system('convert -flatten -background \#ffffff -density 400 -adaptive-resize 1900x infile.pdf outfile.jpg') However, PythonMagick does not seem to have a flatten method and the following snippet produces an image with a black