convert multipage PDF to high-resolution animated gif
Posted: 2014-05-27T18:27:39-07:00
Hi all,
I have made some progress on this question via google, but I have gotten stuck.
My goal is to convert a multipage PDF file into an animated gif.
I have done this successfully with:
convert -delay 20 stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.pdf stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.gif
...however, the images (which are 12" wide x 6" tall in the PDF, and looks good as a vector image in the PDF) come out blurry under this command, and also the image displays in a browser as rather small (perhaps 6" wide, yes I clicked the zoom option to make sure it wasn't some preview).
In an attempt to produce a bigger, and higher resolution, image, I tried:
convert -delay 20 -extent 1200x600 stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.pdf stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines_larger.gif
...this improved the resolution nicely, but the image display size is the same.
I then tried various combinations of "-resize" and "-extent", but it appears that I can only increase the size, or the resolution, but not both. E.g.:
convert -delay 20 -background white -resize '150%' -extent '3200x1600<' -background white stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.pdf stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines_larger5.gif
...the image is now a good size, but still blurry. Higher values for -extent produce "malloc" errors. I would try troubleshooting these, maybe there is a way to increase memory, but I'm not even sure I'm "doing it right" to start.
UPDATE: Actually, this is (almost) the right size and resolution:
convert -delay 20 -background white -resize '150%' -density 144x144 -background white stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.pdf stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines_larger6.gif
...however, now I am getting an issue where it looks like many of the gifs in the animation are writing on top of each other, rather than completely clearing the previous image and writing a new one, which is what I want. Strangely, I only saw this sometimes in the previous runs, and I can't find a pattern to which commands are causing this problem.
Any help very much appreciated here or via email! Cheers!
Nick
matzke@nimbios.org
I have made some progress on this question via google, but I have gotten stuck.
My goal is to convert a multipage PDF file into an animated gif.
I have done this successfully with:
convert -delay 20 stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.pdf stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.gif
...however, the images (which are 12" wide x 6" tall in the PDF, and looks good as a vector image in the PDF) come out blurry under this command, and also the image displays in a browser as rather small (perhaps 6" wide, yes I clicked the zoom option to make sure it wasn't some preview).
In an attempt to produce a bigger, and higher resolution, image, I tried:
convert -delay 20 -extent 1200x600 stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.pdf stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines_larger.gif
...this improved the resolution nicely, but the image display size is the same.
I then tried various combinations of "-resize" and "-extent", but it appears that I can only increase the size, or the resolution, but not both. E.g.:
convert -delay 20 -background white -resize '150%' -extent '3200x1600<' -background white stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.pdf stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines_larger5.gif
...the image is now a good size, but still blurry. Higher values for -extent produce "malloc" errors. I would try troubleshooting these, maybe there is a way to increase memory, but I'm not even sure I'm "doing it right" to start.
UPDATE: Actually, this is (almost) the right size and resolution:
convert -delay 20 -background white -resize '150%' -density 144x144 -background white stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines.pdf stochastic_maps_DEC_vs_DECj_M3_v1_WORKED_ARCHIVE_yes_dotted_lines_larger6.gif
...however, now I am getting an issue where it looks like many of the gifs in the animation are writing on top of each other, rather than completely clearing the previous image and writing a new one, which is what I want. Strangely, I only saw this sometimes in the previous runs, and I can't find a pattern to which commands are causing this problem.
Any help very much appreciated here or via email! Cheers!
Nick
matzke@nimbios.org