wand

Python Wand convert PDF to PNG disable transparent (alpha_channel)

。_饼干妹妹 提交于 2019-11-27 03:51:49
I'm trying to convert a PDF to PNG - this all works fine, however, the output image is still transparent even when I believe I have disabled it: with Image(filename='sample.pdf', resolution=300) as img: img.background_color = Color("white") img.alpha_channel = False img.save(filename='image.png') The above produces the images but are transparent, I also tried the below: with Image(filename='sample.pdf', resolution=300, background=Color('white')) as img: img.alpha_channel = False img.save(filename='image.png') which produces this error: Traceback (most recent call last): File "file_convert.py",