Need help with sips (scriptable image processing system)


I find myself in need of some “sips” (scriptable image processing system) troubleshooting.

I’m trying to have a Keyboard Maestro macro (I found shared on the internet) work: the macro get the selected pdfs in finder and ocr them with tesseract: to do that it convert the pfd in tiff via sips.

Here’s the two commands that do the trick

cd ~ && /usr/bin/sips -s format tiff "$KMVAR_percorso" --out "$KMVAR_TheOutPathTIFF"
cd ~ && /usr/local/bin/tesseract "$KMVAR_TheOutPathTIFF" "$KMVAR_TheOutPath" -l ita pdf

My problem is that sips, with multipage pdfs, converts only the first page to tiff. Other than this issue the macro run as intended. On the macro author machines the problem does not occur.

Sips behave the same if I just try to convert a multipage pdf into tiff from the terminal

sips -s format tiff test.pdf --out test.tiff

I read the man page for sips and done some googling around, but haven’t been able to find a solution, so I hope someone in the community has some idea of what’s going on… :smiley:

If you don’t find a solution using sips you can try imagemagick.


On my machine (Catalina) sips does not convert multipage PDFs into multipage TIFFs, so you’re not crazy. I am skeptical that it does so on the macro author’s computer.

The way I have always dealt with turning multipage PDFs into bitmapped images (usually PNGs or JPEGs) is to first use PDFtk and its burst command and then apply sips to do the conversion, e.g.,

pdftk example.pdf burst output example%02d.tiff
sips -s format tiff example*.tiff

Unfortunately, this leaves you with a set of TIFF files, named example01.tiff, example02.tiff, etc., one for each page. This is typically what I want, but it may not fit your needs. You’d have to use pdftk again to merge the output of tesseract back into a single PDF, and that might be too much messing around for your taste.

ImageMagick’s convert, as mentioned by @JohnAtl, can create multipage TIFFs, but I’ve had trouble controlling the output resolution. It’s likely that I just haven’t spent enough time experimenting with it.

1 Like

thank you @JohnAtl and @drdrang, it’s good to see I’m not crazy :smiley:

I’ll check your alternatives as soon as I can and hopefully report back with a working solution!

1 Like