How to convert a progressive jpeg to a baseline jpeg with applescript?

I would like to convert images from "progressive" jpeg to "baseline" jpegs with applescript.

I would appreciate to use only tools/apps which are shipped with Mac OS X, like "sips" or

"Image Events".

Is there any possibility?


Thanks in advance!

Posted on Apr 18, 2014 5:56 AM

Reply
8 replies

Apr 18, 2014 7:13 AM in response to griffonwoody

This is turning out to be harder then it should be. I tried a bunch of things with Image Events but so far nothing has worked.


The only way I've been able to convent a progressive jpg to baseline is to open it in GIMP and then export it, the GIMP export dialog has options to save as baseline or progressive.


Even using Preview and it's export command didin't do it.


I'll keep picking at this, if you come up with a solution post back.

Apr 18, 2014 12:04 PM in response to Frank Caggiano

Thanks again for your answer! But saving in another format will always lower the quality of the image, so it is not really a good solution.


At the moment I'm using a python script with PIL (which I wrote a few weeks ago), but I would like to have a solution, which is working on every Mac and PIL (the python image library) is not available out-of-the-box, it has to be compiled and installed.


Thanks....

Apr 19, 2014 12:05 PM in response to griffonwoody

Here's a small script to get you started with Image Events if you need it:


set inFile to choose file with prompt "Select JPG File" of type "public.jpeg"

set outFile to choose file namewith prompt "Output file name" default locationpath todesktop

set outFile to (outFile as text) & ".jpg"


set tempFile to (path to desktop as text) & "tmp.tiff"


tell application "Image Events"

set im to open inFile

save im as TIFF in tempFile with icon


closeim

set im to open tempFile


saveimasJPEGwith compression levelhighinoutFile with icon

end tell




regards

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to convert a progressive jpeg to a baseline jpeg with applescript?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.