Which image format should I use?

Many image file formats exist, but which ones are better for what task? Here is a quick overview in my little series of PhD advice blog posts (the previous being tips on dissertation writing and the public PhD defense). Two different image types When choosing a file format for your image, the first thing is to figure out whether you are dealing with a raster image (photos) or a vector image (line illustrations)....

September 26, 2023 · 4 min · 679 words · ARJ

Editing PDF metadata

Sometimes it is necessary to check, remove or modify the metadata of PDF files. Here is a quick post to show how it can be done in the terminal on Ubuntu Checking PDF metadata Most PDF viewers have an option for showing the metadata of PDF files. This can also be done in the terminal using the “pdfinfo” command-line tool. First, we need to install the “poppler-utils” package: sudo apt install poppler-utils Once installed, you can check the metadata by using the following command:...

April 10, 2023 · 1 min · 186 words · ARJ

Adding Title and Author to PDFs exported from Jupyter Notebook

I am doing some end of the year cleaning on my hard drive and just uploaded the Jupyter Notebook I used in the analysis of a mobile phone lying still earlier this year. For some future studies, I thought it would be interesting to explore the PDF export functionality from Jupyter. That worked very well except for that I didn’t get any title or author name on top: Then I found a solution on Stack Overflow....

December 30, 2022 · 1 min · 127 words · ARJ

Scripting image exports with LibreOffice Draw

As mentioned yesterday, the source files for the illustrations in my Sound Actions book are available on GitHub in the form of LibreOffice Draw files (ODG). Draw may be less powerful but much easier to work with than more advanced line art software, such as Inkscape. One of the nice things about the LibreOffice package is its scripting possibilities. While working on my book, I wrote a shell script that would read all the ODG files in a folder and convert them to PDF and PNG files:...

December 21, 2022 · 1 min · 210 words · ARJ

Export images from a PDF file

I have previously written about how to export each of the pages of a PDF file as an image. That works well for, for example, presentation slides that should go on a web page. But sometimes there is a need to export only the images within a page. This can be achieved with a small command line tool called pdfimages. One way of using it is: pdfimages -p -png file.pdf image This will export all images in file....

June 16, 2022 · 1 min · 135 words · ARJ

Improving the PDF files in the NIME archive

This blog post summarizes my experimentation with improving the quality of the PDF files in the proceedings of the annual International Conference on New Interfaces for Musical Expression (NIME). Centralized archive We have, over the last few years, worked hard on getting the NIME adequately archived. Previously, the files were scattered on each year’s conference web site. The first step was to create a central archive on nime.org. The list there is automagically generated from a collection of publicly available BibTeX files that serve as the master document of the proceedings archive....

August 24, 2020 · 8 min · 1544 words · ARJ

Shell script for compressing PDF files on Ubuntu

I have previously written about a shell script) for compressing PDF files in Ubuntu. Here are some variants of the script. Low, mid, and high resolution Low resolution for screen: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf in.pdf I prefer the “ebook” mode, which has slightly higher resolution: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf in.pdf And then there is the high resolution for printing: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out....

August 23, 2020 · 1 min · 175 words · ARJ

Creating individual image files from presentation slides

How do you create full-screen images from each of the slides of a Google Docs presentation without too much manual work? For the previous blog post on my Munin keynote, I wanted to include some pictures from my 90-slide presentation. There is probably a point and click solution to this problem, but it is even more fun to use some command line tools to help out. These commands have been tested on Ubuntu 19....

November 29, 2019 · 1 min · 191 words · ARJ

Split PDF files easily using Ubuntu scripts

One of the fun parts of reinstalling an OS (yes, I think it is fun!), is to discover new software and new ways of doing things. As such, it works as a “digital shower”, getting rid of unnecessary stuff that has piled up. Trying to also get rid of some physical mess, I am scanning some piles of paper documents. This leaves me with some large multi-page PDFs that I would like to split up easily....

December 27, 2016 · 2 min · 217 words · ARJ

Shell script for compressing PDF files on Ubuntu

Back on OSX one of my favourite small programs was called PDFCompress, which compressed a large PDF file into something more manageable. There are many ways of doing this on Ubuntu as well, but nothing really as smooth as I used to on OX. Finally I took the time to figure out how I could make a small shell script based on ghostscript. The whole script looks like this: #!/bin/sh gs -sDEVICE=pdfwrite -dCompatibilityLevel=1....

June 29, 2016 · 1 min · 139 words · ARJ