Image processing

Basic tools

Photoshop and GIMP are common tools for image processing.

For bulk image processing, ImageMagick is recommended if the actions to be performed are the same on each image.

Extracting images from PDF files

If the PDF file is not a scan, then typically the images can be extracted with the Linux command pdfimages. Example command: pdfimages -j foo.pdf bar will extract to bar-000.jpg, bar-001.jpg, bar-002.jpg, etc. This will not work for vectorized images.

If the PDF file is a scan or the plots are vectorized, it can be opened in GIMP or Photoshop and you can select the part of the paper which you want and save it separately. For vectorized images, it might be better to extract the image in Inkscape or something similar.

If you want to convert all pages to images, you can use Ghostscript on Linux, e.g.: gs -SDEVICE=tiffg4 -r300x300 -sPAPERSIZE=letter -sOutputFile=directory/name_%04d.tif -dNOPAUSE -dBATCH -- file.pdf will extract all pages of file.pdf at a resolution of 300 dpi to the folder named directory.

Extracting data from plot images

If you have extracted a plot and want data from it, tools like g3data, WebPlotDigitizer, GraphClick can be very useful (other options discussed here). These allow you to point and click to grab data points and save them as a spreadsheet. For continuous curves, DataThief can nearly automatically recognize the curve in most cases.

For precision when selecting points, you can use a feature called "mouse emulation" to control the mouse by the keyboard. This will allow you to get exactly the right pixel of the plot with ease.

If the paper is more recent, it probably would be a better use of your time to email the authors than to extract the data yourself. This has the added advantage of introducing no transcription errors into the data.

If the paper was part of someone's PhD research, frequently the data will be tabulated in the dissertation. Tracking the dissertation down may also save time and reduce transcription errors.

Creating animated movies and gifs

Webm Movies

sudo apt-get install mjpegtools

sudo apt-get install vpx-tools

 

png2yuv -I p -f 24 -b 1 -n 1440 -j my_image_%05d.png > my_vid.yuv

 

Where:

-I p    Non-interlaced.

-f 24  24 frames per second.

-b 1    Start with image number 1.

-n 1440  The number of images to process.

-j my_image_%05d.png   The file name pattern.  %05d is the expanded to 00001, 00002, ..., 01440.  %03d would expand to 001, 002, etc.

> my_vid.yuv  Send output to a file instead of dumping it to your console screen.


vpxenc --good --cpu-used=0 --auto-alt-ref=1 --lag-in-frames=16 --end-usage=vbr --passes=2 --threads=2 --target-bitrate=3000 -o my_vid.webm my_vid.yuv

Gifs

convert -delay 20 -loop 0 *.png mygif.gif


 

http://blog.ahfr.org/2008/03/making-animated-gifs-with-free-software.html