ImageMagick PDF to JPGs sometimes results in black background

后端 未结 3 1997
庸人自扰
庸人自扰 2021-02-02 06:05

I have the following:

ghostscript-fonts-5.50-24
ImageMagick-6.7.2-1
ghostscript-9.02-1

Which I use to create a series of JPGs for each page usi

相关标签:
3条回答
  • 2021-02-02 06:33

    Simple fix to this issue is to use an image format that supports transparency, such as png.

    So:

    convert -density 175 -colorspace sRGB test.pdf -resize 50% -quality 95 test.png
    

    Problem solved :)

    0 讨论(0)
  • 2021-02-02 06:34

    If you want a high quality result, use this command:

    convert -density 700 input.pdf -resize 25% -append  -quality 98 -alpha remove output.jpg
    

    For windows users, use magick instead of convert

    0 讨论(0)
  • 2021-02-02 06:54

    Ran into this one today, found this:

    https://www.imagemagick.org/discourse-server/viewtopic.php?t=20234

    Based on that, these should all work:

    • -flatten
    • -alpha flatten
    • -alpha remove

    I'm currently using the below for my specific case which works great:

    convert -thumbnail "1280x800>" -density 300 -background white -alpha remove in.pdf out.jpg
    
    0 讨论(0)
提交回复
热议问题