Sto cercando di convertire un PDF in PNG - questo tutto funziona bene, però, l'immagine di uscita è ancora trasparente anche quando credo di avere disabilitato:Python Wand convertire i PDF in PNG disabilitare trasparente (alpha_channel)
with Image(filename='sample.pdf', resolution=300) as img:
img.background_color = Color("white")
img.alpha_channel = False
img.save(filename='image.png')
che questo produce le immagini, ma sono trasparenti, ho anche provato il seguito:
with Image(filename='sample.pdf', resolution=300, background=Color('white')) as img:
img.alpha_channel = False
img.save(filename='image.png')
che produce questo errore:
Traceback (most recent call last):
File "file_convert.py", line 20, in <module>
with Image(filename='sample.pdf', resolution=300, background=Color('white')) as img:
File "/Users/Frank/.virtualenvs/wand/lib/python2.7/site-packages/wand/image.py", line 1943, in __init__
raise TypeError("blank image parameters can't be used with image "
TypeError: blank image parameters can't be used with image opening parameters
oh, così buona risposta. grazie – madjardi