1

I created a movie file from a set of PDF files using:

mogrify -verbose -density 500 -resize 800 -format png ./*.pdf"
convert -delay 600 *.png movie.mp4

on Microsoft Windows 10 (requires Imagemagick and Ghostscript to be installed). The first command converts PDF files to PNG. The second command converts PNG files into 1 MP4 file.

When I opened the resulting movie.mp4 in VLC, the background of the video is black, whereas the background of the pictures are white. How can I fix this issue?

Franck Dernoncourt
  • 20,384
  • 48
  • 186
  • 322
  • 1
    Most probably a transparency layer that `convert` does not handle properly. Can you share one of those PNGs? – slhck Aug 08 '17 at 16:05
  • @slhck Unfortunately I cannot :( I just wrote a python script to generate some PDF plots, but they don't have this background issue. You are correct: it looks like the issue stems from the presence of a transparency layer. – Franck Dernoncourt Aug 08 '17 at 16:18
  • @slhck To prevent mogrify from adding the transparency layer: `mogrify -background white -alpha off -verbose -density 500 -resize 800 -format png ./*.pdf` – Franck Dernoncourt Aug 08 '17 at 16:24
  • @slhck You should post this as an answer. – Giacomo1968 Aug 08 '17 at 16:38

1 Answers1

2

As slhck pointed out in the comments, the issue stems from a transparency layer that convert does not handle properly.

To prevent mogrify from adding the transparency layer, add -background white -alpha off:

mogrify -background white -alpha off -verbose -density 500 -resize 800 -format png ./*.pdf`
Franck Dernoncourt
  • 20,384
  • 48
  • 186
  • 322