4

Preview defaults to saving as PNG. I can change PNG to JPEG, but I have to do it every time.

Is there a way to change the default behaviour?

Is there a way to change the default save/export format in Preview? basically doesn't answer the question, but says that Preview saves it in the form it came in. Well, sort of. If I'm browsing google images, and right-click copy image, even though it's a jpeg image originally, when you past as new selection, it will default to save as PNG.

How can the default save format be changed for OS X Preview app? gives two solutions for someone who wants to save as PDF -- one using a python script, and two using a shortcut key mapped to export as PDF.

Neither of these solutions is workable.

A: In many cases I have a bunch of intermediate steps, editing the image in Preview. Most images will have a crop, a resize, and an annotate. I suppose in principle the python script could be modified to save the current buffer in preview as a jpeg after I've done the others, but I don't yet speak python.

B: The command shortcut doesn't work, as there is no menu command for "Save as JPEG" Instead the Save menu item opens a modal dialog that requires the input of a name (since New->From Clipboard makes a file with the name "untitled-N") and every time a click on the ribbon control at the bottom of the dialog box to move to JPEG

0

3 Answers 3

2

No easy preference or key is known to change the defaults. Barring a new discovery, plan to use a different app or script image conversion with automation.

You probably already know you could make a keyboard shortcut if an Apple menu to save as JPEG existed, but that’s the crux here. Other questions here have useful details on automation and using python to process the clipboard instead of preview.

0
1

As a workaround, the following example AppleScript code, shown further below, will do a Save As… and select JPEG and can be used in an Automator Service with a Run AppleScript action and a keyboard shortcut assigned to it in: System Preferences > Keyboard > Shortcuts > Services

For testing purposes, in macOS High Sierra, I used: ⇧⌘J

NOTE: This may also require giving Preview accessibility privileges for this to work properly.

tell application "Preview" to activate

tell application "System Events" to tell application process "Preview"
    click menu item "Save As…" of menu "File" of menu bar item "File" of menu bar 1
    click pop up button 2 of sheet 1 of window 1
    click menu item "JPEG" of menu 1 of pop up button 2 of sheet 1 of window 1
    set value of value indicator 1 of slider 1 of sheet 1 of window 1 to 0.9
    click button "Save" of sheet 1 of window 1
end tell

    • The value of value indicator 1 is a decimal value from 0.0 to 1.0.
    • You may need to use some delay commands, e.g. delay 0.2 between lines as needed.

enter image description here


Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors.

-1
  1. If you're using Chrome, there's a natty little extension called Save Image As Type – you can select .png or .webp or whatever every single time. You don't even have to click the extension as it appears as a context menu option when you right-click:

eg Delphiniums – 'Saving image as type'

  1. If you've got a load of existing photos that are .png that you want to change to .jpg, you can also batch 'Export as .png in Finder after the fact, so you could feasibly do this at the end of day/week/project, without the faffage of doing it for each image singly.

  2. For screenshots, you can also make your Mac change default to saving as .jpg

To save all screenshots as .jpg by default, enter this script into Terminal.

defaults write com.apple.screencapture type jpg;killall SystemUIServer

If you ever change your mind and want to revert back to saving all screenshots as .png then this is the script for that:

defaults write com.apple.screencapture type png;killall SystemUIServer

You are now back to the original file format.

As a matter of interest, is this about image quality for space-saving, eg for webpage load times?

I ask as I always seek the opposite of what you're looking for! I actively want my images saved as .pngs and not .jpg or .webp. png being better quality without getting to crazy .tiff levels. 😬

There are of course other ways of ensuring your web images load quickly, rather than feeling you have to make them a .jpg

1
  • You have not addressed how to do this in Preview, as per the question. Currently your answer does not answer the question. Aug 23, 2022 at 12:32

You must log in to answer this question.

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