• Automated Image Resizing in OS X

    I’ve been resizing a lot of images for use on this and other blogs recently. This can be quite tedious and time consuming.

    Originally, I was using Photoshop CS3 to open, resize and save the images in a 1024px max width and a 500px max width and appending the appropriate resolution to the end of the image filename. This is a repetitive, predictable and easily scriptable action.

    OS X includes a utility called Automator that lets you take these repetitive steps, put them in a workflow, and then save and apply this workflow. The general algorithm for this image resize workflow is pretty simple and straightforward.

    This workflow takes one or more images files as input and outputs two image files in same folder as the original images for each source image with the long-side resolution appended to the end of the respective image file.

    Update: I just resize to 1024px and the newer versions of WordPress resize the version you see in the post to 500px.

    Automator

    Here is the algorithm with [Automator action]:

    1.  Apply this workflow to the selected Finder items (i.e. select the images to be resized in Finder) [Get Selected Items]

    2.  Duplicate the images so the original(s) are not overwritten [Duplicate Finder Items]

    3.  Rename the duplicated files: remove the ” copy” text that was added in the filename duplication step and replace it with something meaningful like the resolution [Rename Finder Items]

    4.  Resize the image: set the resolution of the long side of the image to a specified size (1024px) [Scale Images]

    5.  Duplicate the image so the 1024px version is not overwritten [Duplicate Finder Items]

    6.  Rename the duplicated files: remove the “resolution copy” text that was added in the last rename and filename duplication step and replace it with the new resolution [Rename Finder Items]

    7.  Resize the image: set the resolution of the long side of the image to a specified size (500px) [Scale Images]

    This algorithm will work well only if first, the original file has dimension larger that the resolution specified in the first resize operation, and second, the second resize operation size is less than the size specified in the first resize operation.

    Automator Menu

    Finally, once your satisfied your workflow works you can ‘Save As Plug-In…’ from the Automator File menu, save it as a Finder Plug-In, and now it is available from the context menus in Finder. This makes the workflow convenient and simple to find and use.

    This is a pretty long description of a fairly simple process, but I haven’t had any wordy posts recently. Anyway, on to the results: taking a sample image and applying the resize operations manually with Photoshop CS3, using the Save for Web and Device operation with an output format of jpeg with 60% compression results in a 108K 1024×683 image and a 32K 500×333 image. The same operation using my Automator script results in a 140K 1024×683 image and a 44K 500×333 image. See the results for yourself:

    Photoshop resize (click for 1024px wide version):

    Photoshop Resize

    Automator resize (click for 1024px wide version):

    Automator Resize


  • Peugeot Pt. 2

    Peugeot

    I’ve made a little progress on the Peugeot. The chrome is polished, the aluminum is shiny, and the paint is waxed.  What else?  The bearings are repacked and the frame is saved.  On top of that, brakes and barcons are installed and the bars are wrapped. Added components include Panaracer Pasela Tourguard 27×1 1/4″ tires, Cane Creek SCR-5C compact short-reach levers with gum hoods, Cane Creek Crosstop interrupter levers, and finally some Salsa cork tape.

    Broken Simplex

    While cleaning the existing components I found that the Simplex front derailleur was broken. This will delay the project a little, but Karl at Klunk Cycles is finding an appropriate replacement which should arrive shortly. More soon.


  • Peugeot Pt. 1

    Peugeot Before

    Peugeot Frame

    This is a mid-70’s 1981 Peugeot Grand Sport. Watch this multi-part series to see what happens to it. Hint: These people may be appalled at the result.