Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a bunch of pdf files, from which I want to produce a movie.

I'm using sips (on Mac OS) to convert the pdfs to .png, and then produce the movie with ffmpeg.

So far, I'm doing this:

for i in {2..9087}
do 
sips -z 1024 -s format png fig${i}.pdf --out png/fig${i}.png
done

followed by

ffmpeg -qscale 5 -r 20 -b 9600 -i fig%d.png movie.mp4

However, I found that ffmpeg is struggling with the transparency of .png (it renders the movie with blured things). I've read that it is advisable to input the ffmpeg with non-transparent .pngs. So, my workflow has a flaw, since sips apparently does not have a way of exporting non-transparent pngs from pdf.

I'm wonder if anyone already solved this problem, and would like to share the solution.

share|improve this question
    
Looks like you need another intermediary step, take the transparent PNG from sips, and then convert them to non-transparent in another, as yet identified package. – Steve Feb 5 '13 at 12:15
    
Can't you just use an image format that does not support transparency, like jpg? – terdon Feb 5 '13 at 12:51
up vote 1 down vote accepted

As I said in my comment, the easiest way would be to simply use a file format that does not support transparency, .jpg for example. If you need to stick to .png, you can use convert from the ImageMagick suite to remove the transparency:

for i in {2..9087}
do 
   sips -z 1024 -s format png fig${i}.pdf --out png/fig${i}.png
   convert png/fig${i}.png -background=white -flatten +matte aa.png && 
   mv aa.png png/fig${i}.png
done
share|improve this answer
    
Thanks. funny solution but works (the jpeg). The convert tool not so much: it is really slow compared to sips. – J. C. Leitão Feb 5 '13 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .