Batch convert pictures to 4:3 adding black horizontal bands

Discussion in 'Digital Discussion & Q&A' started by Nostromozar, Jun 25, 2008.

  1. Nostromozar

    Nostromozar TPF Noob!

    Joined:
    Jun 25, 2008
    Messages:
    2
    Likes Received:
    0
    First of all... hello everyone! this is my first post.

    I need a program to do the following thing:

    I have thousands of pictures, some of them have 4:3 aspect ratio, others have 3:2 aspect ratio, and a few of them non standar aspect ratios.

    I need all of them to be the same aspect ratio (4:3), adding horizontal black bands if needed but never cropping the picture.

    Can this be done? I can't find this option in the programs I use.

    Thanks!
     
  2. Chris Stegner

    Chris Stegner TPF Noob!

    Joined:
    Dec 27, 2007
    Messages:
    481
    Likes Received:
    2
    Location:
    Ft. Thomas, KY
    Can others edit my Photos:
    Photos OK to edit
    I use Photoshop and I can create an "Action" to apply the same steps to multiple photos. If you don't have PS then maybe a friend would let you use their machine to do it. I use it all the time. You basically tell it to "Record" your steps, then you you direct it to a folder of images and it will do the same to all the images in the folder.
     
  3. Nostromozar

    Nostromozar TPF Noob!

    Joined:
    Jun 25, 2008
    Messages:
    2
    Likes Received:
    0
    Thanks Chris, I use Photoshop CS3, but this is too complicated for an Action.

    I finally managed to do it, but using Photoshop ExtendScript.

    I copy the script here to change to 4:3 in case somebody needs it, you only need to save it with jsx extension in a text file.

    app.preferences.rulerUnits = Units.PIXELS
    app.preferences.typeUnits = TypeUnits.PIXELS
    app.backgroundColor.rgb.red=0;
    app.backgroundColor.rgb.green=0;
    app.backgroundColor.rgb.blue=0;


    var miImagen = app.activeDocument
    var x = miImagen.width
    var y = miImagen.height
    var ratio;
    var xx = x;
    var yy = y;

    if (x>=y) {
    ratio=(x/y);
    if (ratio!=(4/3)) {
    if (ratio>(4/3)) {
    xx=x;
    yy=(x*3/4);
    } else {
    yy=y;
    xx=(y*4/3);
    }
    }
    } else {
    ratio=(y/x);
    if (ratio!=(4/3)) {
    if (ratio>(4/3)) {
    yy=y;
    xx=(y*3/4);
    } else {
    xx=x;
    yy=(x*4/3);
    }
    }
    }

    miImagen.resizeCanvas(xx,yy)
     
  4. Garbz

    Garbz No longer a newbie, moving up!

    Joined:
    Oct 26, 2003
    Messages:
    9,713
    Likes Received:
    203
    Location:
    Brisbane, Australia
    Can others edit my Photos:
    Photos NOT OK to edit
    Nice work. Pity the forum ruins the formatting. Incidently I was going to go ahead and recommend GIMP not knowing you had photoshop since this is hardly the type of thing you would want to spend money for but decided against it when I realised you had to code action scripts in GIMP. I thought it would be too difficult :lol

    Just goes to show you never know.
     

Share This Page

Search tags for this page
4:3 aspect ratio converter pic
,
batch convert to 4:3
,

change the picture to the reation 4:3

,

convert image to 4:3

,
convert photo 3*4 website
,

convert photo to 4:3 ratio

,
convert photos to 3:4
,
gimp change to 4:3
,
how to convert a 3:2 ratio photo to 4:3 ratio
,

i need to edit my pictures to 4:3 ratio