Per fortuna ci da una mano il pacchetto imagemagick. Si installa facilmente da gestore di pacchetti (synaptic) oppure da terminale con sudo apt-get install imagemagick. Uno volta installato basta aprire un terminale, spostarsi nella cartella dove si ha il pdf e dare il seguente comando: convert miofile.pdf miofileoutput.jpg ed un attimo si avrà convertite tutte le pagine in relative immagini jpg. Siccome per ogni pagina corrisponde un immagine, conviene creare una cartella ad hoc per il salvataggio ed evitare la saturazione della cartella corrente (in generale “Documenti”).
da pdf a immagine
Vediamo come convertire agevolmente un file pdf in jpg con Ubuntu:
Ubuntu ha di default il pacchetto imagemagick preinstallato, ci servirà per poter convertire il nostro pdf:
Apriamo il terminale e andiamo nella directory dove è presente il nostro .pdf
Diamo il comando: convert -density 300 nomefile.pdf nomefilechevogliamo.jpg
Il valore 300 dopo -density indica i DPI che vogliamo per la nostra immagine, se non lo specifichiamo il valore di default è 72;
Nel caso il pdf sia di più pagine il comando convertirà tutte le pagine salvandole con nomefile-1.jpg, nomefile-2.jpg, ecc..
Convert PDF to JPG
We’ll use imagemagick to make this, and it is fairly easy, just enter this command.
convert file.pdf file.jpg
And all is done, if your PDF file has a lot of pages, you will find a file-0.jpg file-1.jpg file-2.jpg and file-n.jpg, being n the number of pages your PDF file had.
Convert PDF to PNG
In this case, just change the extension in the command.
convert file.pdf file.png
The consideration about the number of pages in the PDF file is the same as with JPG.
As you can see it is really easy to convert a PDF file to JPG or PNG, you just need to install imagemagick, imagemagick is also useful to take screenshots, and lots of other things.
Published on September 22nd, 2008 by Jean-Baptiste Jung. 149 Comments –
ffmpeg is a multiplatform, open-source library for video and audio files. I have compiled 19 useful and amazing commands covering almost all needs: video conversion, sound extraction, encoding file for iPod or PSP, and more.
Getting infos from a video file
ffmpeg -i video.avi
Turn X images to a video sequence
ffmpeg -f image2 -i image%d.jpg video.mpg
This command will transform all the images from the current directory (named image1.jpg, image2.jpg, etc…) to a video file named video.mpg.
Turn a video to X images
ffmpeg -i video.mpg image%d.jpg
This command will generate the files named image1.jpg, image2.jpg, …
The following image formats are also availables : PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI.
since they’re tearing down the buildings in front of our office and there’s been a cool webcam positioned near the site i wrote a little script to get the images and wanted to convert them into a time-lapse…
here’s the knowledge i gained from this little experiment.
first i thought that image magick could do the trick, i noticed that to create a mpeg2 video i needed a little encode program that i found here.
compiled this and moved it to /usr/bin
then i executed convert in my image directory
convert -delay 10 *.jpg m2v:time_lapse-test.mpg
the output was a nice little motion jpeg which i couldn’t use in my little video software called open movie editor (there’s probably better stuff out there but this is the first one i found and tried and seemed simple)
the important things here is setting the frames per second to 15 and the codec to mpeg4 with a bitrate of 2160000. everything else was gathered on different sites and really almost make no difference (in what you see at least)
so then i quickly edited movie… and saved it, it was way too big so encoded it again but this time with 2 passes and a smaller bitrate:
and here you have it (needs to be high quality because compressed it looks even worse)
well youtube blocked my video saying that a copyright owner has claimed it owns some or all of the audio content in my video. oh well the music industry is just something you shouldn’t support! just don’t understand why you can’t have a little video online that even mentions the music at the end and might even bring a song to a wider audience!
i encourage everybody to use riaaradar before purchasing their next album!
Now, it saved the file in your home folder. Using the terminal type in
ffmpeg -i Video.mpg Pictures%d.jpg
You can probably change the JPG to PNG. If it doesn’t work using PNG, then use JPG. Just fire up GIMP and save the JPGs as PNGs.
I have a video recorded from my camera (encoded in mp4) and I want to convert it into a series of png images that I need to process separately.
MPlayer has a png output that should do what you are after. You can see if your version of MPlayer has this capability as follows:
andrew@skamandros~$ mplayer -vo help | grep png
png PNG file
Just be a little careful to put some time limits in place or your disk will fill vey quickly:
mplayer inputfile -vo png:z=8 -endpos 5 -ao null
This command stops after 5 seconds of playback but still generated an impressive number of images . To start a little way into your video use the -ss option.
All the best,
Avidemux (GTK+) has this if you want something that has a GUI.