Automating Image Re-sizing in PS, Batch

kcuikcui Registered Users Posts: 71 Big grins
edited December 16, 2012 in Finishing School
I have several large images of various sizes and aspect ratios. I want to place these images on a 1600x900 background. If the aspect ratios are equal to 16:9, then simply transform / reduce the imagge to 1600x900. For those that are not, I want to reduce the height 900px (fit vertically) and have it centered on the background layer. By centering I ensure an equal border on either side of the image (letterboxing, but vertical).

Right now I am manually opening the images as layers, pasting them into a 1600x900 background, the free transforming them to match 900px height. Then I crop to the (now re-sized image), and expand to canvas relative to the image to make a 1600x900 image.

In a nutshell, I am reducing my images with the constraint that they have a 900px height and be centered.

Is there any way to automate this? Obviously I can't record an Action as my sizes vary. Is there a way the program/script this? It obviously requires a little bit of math.

Does anyone know of a better way to do this that doesn't require scripting? It it a bit time consuming at the moment....

Thanks!

BACKSTORY:
You may wonder why I want to do this. For my 16:9 images, my website will display them in a fullscreen mode. However for non 16:9 images it will stretch the width to fit, so I end up with wide images but cropped vertically. I have a letterboxing option which will center these and not crop them, but then my 16:9 images end up with an ugly border on top (when I want them fullscreen on the browser).
A work in progress...

http://kristophercui.com

Comments

  • puzzledpaulpuzzledpaul Registered Users Posts: 1,621 Major grins
    edited December 13, 2012
    Since you're a Canon user, then there's a workflow using DPP that'll let you do the resizing to a specifed crop and pixel dimension.
    Chances are, you already know - but just in case.

    Select images to be modded
    View > image edit window
    Tools > Trim / angle adjustment
    Aspect ratio > custom ... 16 and 9
    Drag marquee over required area > ok (note that you'll end up with 1600 x 900 ... irrespective of the displayed pixel dimensions under the crop tool)
    Repeat
    Return to main window ... where you'll see your pix with crop marquees
    File > batch process ... enter relevant info ... and DPP will dump all your pix @ 1600 x 900 where it's told.

    I'd then create a layer in PS of the required size to give an equal width border around said pix
    Open modded images, and drag (with shift) each pic onto bg layer.

    Or just open modded pic, Increase canvas size as appropriate, with desired colour ... and ok.(probably better from the non-re-naming pov)

    There may well be other / better options with later versions of PS (or with mine that I don't know about :) ) ...but this's how I'd do this with the gear I have available.

    pp
  • BinaryFxBinaryFx Registered Users Posts: 707 Major grins
    edited December 13, 2012
    Am I missing something here? Have you actually tried recording an action and testing?

    In image size, if you only change the height to 900px in image size, that is all that is recorded in the action.

    There is also the option under file/automate/fit image...

    Let me know if this does not work for you, it should be easy enough to do via an action.


    Regards,

    Stephen Marsh
  • kcuikcui Registered Users Posts: 71 Big grins
    edited December 13, 2012
    BinaryFx wrote: »
    Am I missing something here? Have you actually tried recording an action and testing?

    In image size, if you only change the height to 900px in image size, that is all that is recorded in the action.

    There is also the option under file/automate/fit image...

    Let me know if this does not work for you, it should be easy enough to do via an action.


    Regards,

    Stephen Marsh

    Steve, I will give this a try when I get home. To be honest, I don't have much experience using actions in PS. I may have some misconceptions on exactly how they work. Again, I'll play around some tonight and post an update.
    A work in progress...

    http://kristophercui.com
  • puzzledpaulpuzzledpaul Registered Users Posts: 1,621 Major grins
    edited December 13, 2012
    Misunderstood OP - thought you wanted to re-shape (as well as re-size) non 16:9 images onto a 169 background ...rather than use just a 900px high datum and have (equal amounts of) dead space L and R.

    pp
  • kcuikcui Registered Users Posts: 71 Big grins
    edited December 14, 2012
    Played around with the Actions and worked like a charm. I guess I underestimated their use.

    That said, I guess you still need to be careful with them. If I do something like "Select Layer XXXX" it will fail on images that have different layer names.

    There are ways around it, just make sure you don't do anything that specifically calls out a layer.
    A work in progress...

    http://kristophercui.com
  • arodneyarodney Registered Users Posts: 2,005 Major grins
    edited December 15, 2012
    The update to CS6 just released now provides conditional actions!
    Andrew Rodney
    Author "Color Management for Photographers"
    http://www.digitaldog.net/
  • BinaryFxBinaryFx Registered Users Posts: 707 Major grins
    edited December 15, 2012
    ImageReady CS had conditional actions, while Photoshop CS did not. Until this update to CS6 that Andrew mentions above, one had to use a script (see link below). This addition to CS6 is really good news!

    http://actionlogic.blogspot.com.au/ (Siva's Photoshop Conditional Action - Script for CS2>)

    Andrew, would it be possible to provide a screen capture of how the conditional controls are presented, what options etc? I have attached a sample from IRCS.


    Stephen Marsh


    ______
  • arodneyarodney Registered Users Posts: 2,005 Major grins
    edited December 15, 2012
    conditionals.jpg
    Andrew Rodney
    Author "Color Management for Photographers"
    http://www.digitaldog.net/
  • BinaryFxBinaryFx Registered Users Posts: 707 Major grins
    edited December 16, 2012
    Thank you for the screenshot Andrew. I found a short video with a demo, it appears that the if/then steps simply trigger an action in CS6. So the conditional steps have improved beyond what the old ImageReady CS program had, while the if/then is limited when compared to what IRCS offered. I hope that Adobe continue to improve upon and add further conditional functions to CS6>.


    Stephen Marsh
Sign In or Register to comment.