16

I have a lot .jpeg, .png and .pdf Files and I want to convert all of them to .tiff all at once.

How can I do this?

6 Answers 6

17

You can use sips:

for i in *; do sips -s format tiff $i --out $i.tif; done

Bash.

4
  • 2
    I love that sips ships with darwin / OSX!
    – bmike
    Commented Mar 1, 2012 at 21:38
  • 2
    As far as I know, Image Events is only an (AppleScript-enabled) application wrapper to the SIPS command line utility.
    – fanaugen
    Commented Mar 2, 2012 at 10:06
  • 1
    It should be for i in *; do sips -s format tiff $i --out $i.tif; done. Otherwise you'll get Error: Unsupported output format tif Commented Jul 27, 2017 at 23:39
  • Here's another option on how to solve the multi-page PDF limitation: apple.stackexchange.com/a/365583/249129 Commented Jul 29, 2019 at 16:35
12

Automator

You can batch convert these files by:

  1. Open Automator from /Applications

  2. Create a new Workflow

  3. Drag the Get Specified Finder Items to the workflow builder.

  4. Drag the Change Type of Images to the workflow builder. This will prompt you to add the Copy Finder Items action as a backup option. That's up to you.

  5. Click the Add... button in the Get Specified Items action and select all your picture files.

  6. Select the desired image type in the Change Type of Images.

  7. Click the Run button.

  8. Enjoy your batch converted photos!

In the end, your Automator window should look like this:

enter image description here

3
  • 2
    I would make one slight change—primarily a matter of preference. I would create this workflow as an application and eliminate the Get Specified Finder Items step. This would convert any image file, including single page PDF, or folder of image files, dragged onto the application icon into TIFFs. (Or, more properly said, make TIFF copies of all those files and place the copies on the Desktop.) This eliminates the need to pre-define the files to be converted and allows you to reuse the workflow for future conversions.
    – jaberg
    Commented Mar 1, 2012 at 18:36
  • Yeah, that works too.
    – Matt Love
    Commented Mar 1, 2012 at 19:34
  • Is it possible to set this up so you can run it from Finder without having to set it up every time? Like, right click file > Convert to PNG, or whatever? Commented Jun 13, 2014 at 15:50
5

However, the Automator solution by @Matt Love will not convert multipage PDF files to individual TIFFs. You would need to run two separate Automator workflows, one to convert PDF files to images and one to change the format of image files. As an alternative, you might consider using AppleScript with Mac OS X's built-in Image Events.

Unlike a simple Automator workflow, the script given below (syntax-colorized version here) converts images and PDF files to TIFF, does error reporting and does not break down when failing to handle some files. Before running the script, select the files to be processed in Finder.

EDIT: For multi-page PDFs, only page 1 is converted.

# this script converts all PDFs and images selected in Finder
# to the TIFF format and appends .tif to the file name

set t to (time of (current date))
tell application "Finder" to set sel to selection
set errors to {}
tell application "Image Events"
    repeat with img_file in sel
        try
            set img_file to img_file as text
            set img to open img_file
            save img as TIFF in (img_file & ".tif")
            if (class of result) is not file then error "could not convert to TIFF"
            close img
        on error errMsg
            set errors to errors & ((name of (info for (img_file as alias)) & ": " & errMsg & "\n") as text)
            try
                close img
            end try
        end try
    end repeat
end tell

# error report
set errcount to length of errors
set msg to (((length of sel) - errcount) as text) & " files converted to TIFF in " & ¬
    (((time of (current date)) - t) as text) & " seconds.\n\n"
if errors is not {} then
    set msg to msg & errcount & " errors occurred: \n" & errors as text
end if
display dialog msg
3
  • The Change Type of Images Automator action, at least the version provided with OS X 10.7, will convert single page PDF documents to a TIFF file. I've edited the answer to say you can't use it on multi-page documents. I haven't decrypted the Applescript to determine how it works with multi-page documents.
    – jaberg
    Commented Mar 1, 2012 at 18:33
  • In Snow Leopard, the Change Type of Images Automator action does not process single-page PDFs either. The AppleScript converts PDFs to TIFF, but only the first page in multipage PDFs (thank you for pointing this out).
    – fanaugen
    Commented Mar 2, 2012 at 10:03
  • I just checked on a Snow Leopard system and the Change Type of Images module does convert single page PDF files—at least according to the documentation. I will test the function later.
    – jaberg
    Commented Mar 2, 2012 at 17:28
3

Next to an Automator script or a commercial tool to solve for multi-page PDFs, another option is to use ImageMagick's convert tool. For example executing the following from the same directory:

for i in *; do magick convert -density 300 ./$i -depth 8 ./$i.tiff; done
1
  • Have to install Homebrew and do brew install imagemagick first if you haven't already
    – Alex W
    Commented Oct 7, 2019 at 18:24
2

On a Mac, you can also cd into the directory of your image, and use:

sips -s format tiff input.pdf --out output.tiff

Source: http://www.mactricksandtips.com/2008/07/convert-images-using-terminal.html

0

I believe you could construct such a custom workflow using the commercial program GraphicConverter (US $40). You would use it a stand-alone program, but it also has certain functions that can be used in Automator workflows.

Here is some information from GraphicConverter's page explaining their batch processing image editing functions.

Batch conversion with additional functions

GraphicConverter offers you sophisticated batch processing which fully automates repetitive tasks applied to a selection of pictures:

  • Convert all the selected source pictures easily and quickly into a new format - regardless of whether there are 5 or 5,000 picture files; you just define the type of conversion and set the details
  • During the conversion process you can apply up to 60 additional batch functions such as rotation, resize, change the resolution, etc.
  • Automate the removal of the Mac OS Ressourcefork before documents are uploaded if there are compatibility problems when the picture files are placed in the internet
  • Create catalogs in HTML format for publication in the internet and adjust the colors, sizes, etc. to your individual requirements (see examples)
  • Rename a selection of documents according to special criteria quickly and easily
  • Join pictures together (e.g. for QuickTime VR)
  • Insert or extract IPTC information into or out of a variety of document formats
  • and much more ...

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .