Python Wand converts from PDF to JPG background is incorrect

后端 未结 3 794
北恋
北恋 2020-12-10 18:30

I found a so wired thing while converting a pdf to jpeg, so i\'d like to figure out that maybe this is a small bug. See the converted jpg below, you could find that, the bac

3条回答
  •  心在旅途
    2020-12-10 19:17

    I got the answer by myself. It's because of the alpha_channel case. This pdf includes some transparent background(after i transfomred to png format), and for resize, ImageMagick choose the best resize filter, so black background displayed.

    So, after a lot of experiments, I found that just add "img.alpha_channel=False" in "with" statement(before img.save()), that would work properly.

    Thanks for VadimR's advise, it is helpful.

提交回复
热议问题