Batch increase canvas based on the proportions of each image

Hello

I'm new to scripting, so expect stupid questions

I need to take pictures of 1900, make them square by increasing the canvas of each image and then convert them to 600x600px

The thing that is stumping me is that each image source has a ratio of different size\aspect

Is this possible?

TIA

I guess you could same Action with file > Automate > Fit Image and then use the canvas size.

But for what is a script, you can simply use a conditional clause:

#target photoshop
var myDocument = app.activeDocument;
var width = myDocument.width;
var height = myDocument.height;
if (width > height) {
     myDocument.resizeCanvas (width, width)
     }
else {
     myDocument.resizeCanvas (height, height)
     };
myDocument.resizeImage (new UnitValue(600, "px"), new UnitValue(600, "px"), undefined, ResampleMethod.BICUBIC);

Tags: Photoshop

Similar Questions

  • Crop canvas based on the suffix of the filename (big, _medium, details)

    I have this recurring task of cropping of images, on a daily basis, each in 3 different versions, a 630 x 515 * grand, a 274 x 134 * _medium and a 173 x 106 * details.

    I am currently working with 3 different actions (select canvas > copy > resize > paste in place) one for each size, since I have to manually free transform it and choose a suitable such as visible place (report l / h of the source images varies a lot).

    Yet, I need to check the name of the file and then use the correct action, which given the amount of time I do it, it is not only slow, but also prone to errors.

    I have a button that I can use that is only mentioned action (even if she calls just adequate action) based on the file name suffix.

    I made a blunder in the code.  These two lines to replace lines 4 & 5:

    var docName = docRef.name.split('.') [0] .split ('_');

    var docSize = docName [docName.length - 1]

  • How to create the current header primary and secondary based on the title of each chapter?

    Hello
    I want that every page has a primary header running IE title of the book, while each subsequent page after that, also has a header running, but based on the title of a chapter.

    Book title                                                                 |  1

    First chapter title.  2

    Book title                                                                 |  3

    Second chapter title |  4

    Book title                                                                 |  5

    Third chapter title |  6

    Book title                                                                 |  7

    Fourth chapter title |  8

    .. and so on...


    Would be very happy for any help.

    Like, rachida

    Text variables - YouTube

  • Dynamic MessageChoice based on the value of each line

    Hi all

    I'm trying to implement a requirment, don't know how I can acchive this in the OPS.
    I appriciate any person that makes me in the right direction


    How to have a dynamic messageChoice in OAFTable.

    My scenario is like this,


    OAFTable [UI Table]
    ========================================
    | Name | xxx movies | MessageChoice values.
    ========================================
    | 12-A | xxx movies | Apple, Airport |
    | 15-B | xxx movies | Ball, box |
    | 20 S | xxx movies | Singapore |
    =======================================|


    VALUE_TABLE [table DB]
    =======================
    | Letter | Value |
    =======================
    | A     | Apple |
    | S     | Singapore |
    | A     | Airport |
    | B | Ball |
    | B | Box |
    =======================

    (There is a messageChoice column in my third OAFTable represented above column).
    the values for this messageChoice must be filtered on the 'Name' column in each snippet of it IE row letter and use this value to filter the values of VALUE_TABLE.

    Where clause for each message lines choice should change dynamically as

    Rank 1: select the value in VALUE_TABLE where letter = "A".
    Rank 2: select the value in VALUE_TABLE where letter = 'B '.
    Rank 3: select the value from VALUE_TABLE where letter = 'C '.

    Since the messageChoice EVENT is generated only after the exchange of value, I cann which allows to change the place where the clause of the VO.

    Is there a feature in OAF WHERE clause of that VO modifyes for each line?


    What will be the ideal approach to acchive. Surely someone would have solved this kind of scenario...

    Thanks for your suggestions in advance :)

    Srinath

    Hello

    Yes there is an available standard approach

    Consider a container, such as a table that has two columns. A column is a Department, while the
    another column shows all employees of this Ministry in a poplist. The view object used for the poplist
    (The view definition list pick) needs the number of Department (the "Deptno" of the container field) destined for bind
    variable: 1. This can be done with the following sample code in the processRequest of the controller method:
    Table OATableBean =...
    OAMessageChoiceBean = empPoplist
    (OAMessageChoiceBean) table.findChildRecursive ("EmpName");
    empPoplist.setListVOBoundContainerColumn (0, / * bind index * /)
    table, "Deptno");
    Copy the following lie the first index of (0th) bind to the view of poplist object used to the displayed value by the
    column named Deptno in the table.
    The setListVOBoundContainerColumn method can be called multiple times if the query used for the poplist
    several bind variables. Note that this approach actually simulates a BC4J link, except that it relies on
    the table columns of the user interface for bind rather than object attribute values values view directly.

    Thank you
    Gerard

  • Browse all text layers, read a specific selector and create some key based on the selector of those images.

    Hello

    I have about 50 ~ layers of text, each of them I got a text named 'Anim' with a few keyframes specially positioned selector.

    What I need is to read the key images of each selector Anim and add a new effect (lets say, glow for example) to each layer text to the help of some(not all) of Anim keyframes and the values set on all of them (as we use glow, could be the threshold for example).

    I can handle calculations, that I just need are the syntax to achieve these key frames and assigning values to them.

    Thanks in advance.

    To get the value of a keyframe you just use the method keyValue() as follows:

    SELECT. Property ("End"). KeyValue (i);

    where i is the index key.

    Dan

  • AE, change the proportions of melted images

    I am rendered images .png to DV NTSC, 720 x 480, 0.9 Pixel aspect.  My composition at AE settings are set to the same thing, however, when I import the images that they are listed as 720 x 480 (1.11).  Seen in the compose window frames extend beyond the visible area on both sides.  Using AE 7.0.

    Why this is happening and how to fix it?

    Thanks in advance for your suggestions.

    It will be his weird but it's true. The aspect ratio will not change the pixels. Aspect ratio only defines the interpretation - or tells a video application how these pixels to fit in a space on a scan line. It is a bit like the PPI tag added to images for printing. The tag has nothing to do with the actual pixels.

    That said, if you can't find a setting to choose the format of the pixels when configure you the module output and rendering parameters, then the NOMINAL tag will not be added to make it. AE, or your NLE then take a look at the size of the image and make a proposal as to BY and field order. The assumption can be a problem. If this is the case, all you have to do is go into the settings of interpretation and change.

    I guess that you are a DV codec. If so, there is no tag so ALL you have to do is reset the interpretation. It goes the same for first or FCP or Vegas or any other NLE. Sometimes a DV film is interpreted as evil BY.

    I hope this helps.

  • Lightroom stop return to 'Original' culture aspect ratio / lock the proportions.

    Hi guys.  All the title really, using Lightroom 6.1

    Put, if I click on culture, enter 3 x 2 or any other, adjust my image - all good.

    then I click on the following image - culture returns to 'original' aka if the image is 1 x 1, which corresponds to the crop tool.

    The padlock icon seems doing nothing - for example, 3 x 2 - lock lock set, click again on the next image - back to the 'original '.

    Strangely, sometimes with the ratio is fixed at 3 x 2, just set the handles on the area of harvest will bring him back to original too.

    What can I do to lock it to a report you want and it NEVER changes?

    Makes me crazy.

    The upgrade to 6.5 will not change the behavior. By default, Lightroom is still the proportions of the image. The locking feature has nothing to do with the proportions of one image to another of locking. You lock or a specific ratio for the image, or you unlock so that you can freely crop the image you want.

  • Square (keeping the proportions)

    Hello. Sorry to post again, but since I have not found answer on the forum now only reading...

    I wonder if there is a way to make a place to respond directly from edge.

    The design of the page is a big box on the right (1/3 of the page), are inside the 2 squares (10px border).

    Is there an easy way to make this happen on board?

    SquareThird.png

    I have no problem with the background square cut in the process while displaying the page.

    Of course, everything would be nice on 4:3 screen horizontal iPad (next step is to understand the process of orientation of Chris Gannon)

    Hey, Frank.

    Unfortunately, at this time are the only types that are supported for the proportional scaling of images.  I've been to this there is an element in our internal database tracking feature to make it available in a later version, if!

    Thank you

    -Elaine

  • is there a zero after all the sliders on all images in a folder?

    is there a zero after all the sliders on all images in a folder? Lightroom is the application which seems to be the automatic on all images tone as the sliders of each image are different. all the import options are closed off or to "none", so I have no idea why LR applies these settings. When I reset pictures it puts back the auto import settings. If lightroom is the perception of those as reference. Help, please!

    Go to your preferences, select the Presets tab, uncheck the default all settings, but especially the "apply auto tone adjustments" of development one. For good measure, you can also hit the button 'Reset all parameters of development by default'.

  • Place a point at the bottom of an image

    This might the seams a bit strange, but its my work around a picture of sizing.

    I need to have all the photos point placed down to the center of each image,

    It must be 1px sq and the color 254,254,254.

    The size of the image is.

    I hope someone can help

    Matt

    This can be done with a normal action. Make a new layer. Fill with your color. Turn the scale parameter 1px in the options bar. Select all. Place with layer align botton layer aligncenter. Merge down if you do not want the additional layer.

  • Is it possible to use the mask to an image in other images?

    Hello

    I prepare a product turned to send to a designer. I always create a mask to "pick up" the background, so that the designer can pull the product in InDesgin without picking up the background.

    I would like to send the designer versions 3 and 4 at the same time, with small changes to the detail of the shadows etc, but I'd rather not spend the time to create the same mask of 3 - 4 times.

    Is there a way to create a mask on an image, then copy this mask and place it in the other choices? Its exactly the same time with the same crop each image would be a double right.

    I know that I could ask him to choose and hide his first choice, but there is a bit of a lack of time here and a few layers of people for making the final selection, so he'll do anything that I have much more smooth if I could just send the finished product without creating a lot of back and forth.

    Thanks much for any help!

    Ellen

    If the images are exactly the same size, then make sure that the layer with the mask

    is the layer active and in other documents go Select > load selection and choose

    your document with the mask layer under the document Source and channel select the layer mask.

    After the selection of loads press the icon at the bottom of the layers panel layer mask.

    MTSTUNER

  • Impossible to activate the correction lenses for images

    I try to get all the JPEGs, shot with a particular camera to have profile lens corrections applied to them. So with a jpeg that is selected in the development module I check on "Enable lens corrections" click setup and click "save new lens correction default profile." But it does not work. The next jpeg that I select is not activated lens corrections. Or it does not work if the setting to develop, I click on set default settings > update current settings. I think I have to activate the lenses to each image corrections. What I am doing wrong?

    Settings that you did for images should apply to others or the images differently than what I understand, you were doing:

    You say that you update to current settings >.

    This means that you update your lens correction parameters (that you developed earlier) with the parameters of the new image (which does not have lens applied correctioons).

    Instead, try the following - in the develop Module:

    Once you have the frame for a picture, select more images without deselecting the first image (ctrl + click on the images more).

    Your first image should have a light gray frame, other images, a slightly darker gray frame. This means that all images are selected, but your first image is active.

    At the bottom of the right pane, click . A dialog box appears that allows you to check the settings you want to apply to the other images.

    Check or anything that applies in the case of sub-options of lens correction.

    Click . Your lens correction should now be applied to other images - and also other parameters of development if you checked them.

    WW

  • I use LR5.7 based on Windows 7 and got a few pictures 150 000 in a catalugue. Could import, export and rendering speed be increased, if I store the LR catalog on the same drive as my photos? Today the program, the catalog and the photos are all

    I use LR5.7 based on Windows 7 and got a few pictures 150 000 in a catalugue. Could import, export and rendering speed be increased, if I store the LR catalog on the same drive as my photos? Today, the program, the catalog and photos are all on different drives.

    Import and export and rendering speed depends on the CPU. The disk contributes only a negligible amount to import and export and rendering speed. You would spend more time to pass the photos that you would gain in speed.

  • Need help with a script customized for processing in Photoshop CS4 of images in batches. Really grateful for the help thereby.

    Hi people.

    So I have a boatload of pictures that I have to deal with as I'm moving off Ebay and open my own online store and the images that I have on Ebay, although excellent quality are not square, and unfortunately, the model that I use in Wordpress requires square photos.

    Basically, what I need is a script that I can use in batch mode, which will focus on the size of the image and change the canvas size to be square corresponding to the current long image side. Resize the image to 1600 square pixels and finally save for web in JPEG quality 60.

    Normally I would muddle my way through this trying to teach myself but I already do so much with this new project that I can't afford to pay developers for help that I would really appreciate if someone could help me with this script. I use Photoshop CS4 if it made a difference.

    Thanks much for any help you can offer.

    See you soon,.

    J

    A simple gesture can do that. What you need to do is that the action of lot.   With the help of Photoshop Image Processor script.  The Action is a two-step

    N ° 1). File menu > automate > fit Image.  In the dialog box Image Fit you assign Width and Height 1600 pixels.

    Step 2.) Menu Image > canvas size.  In the canvas size dialog box, you assign Width and Height 1600 Pixels.

    Record the action in some action with a name like 1600PxSquare

    Then use the file menu to Photoshop > Scripts > image processor. In the dialog to the Image Processor script. Select your image source folder. Set where you want your jpeg images. Set it to save jpeg files quality 6.  Set it to include your 1600PxSquare action.

    Step adjustment image resize your image to fit in a 1600 x 1600 pixels are while keeping image proportions of images. Portrait image will be high 1600px and landscape image will be 1600px wide.  The step size canvas will add the canvas to make the place of the image.  Portraits will have a border on the left and right images of landscape will be confined to the op and downs.

  • VI to convert input signals NI 9402 in a RPM value, based on the frequency of the pulses

    Hello

    I'm looking for a VI convert an input signal NI 9402 in a RPM value, based on the frequency of the pulses. Is there such a thing that exists in the library of national instruments?

    I run LAbview 2014 integrated control and monitoring on on a cRIO 9802 high performance integrated system with NEITHER 9402, 4 channels, 50 LV, LV TTL Module input/output digital, ultra high speed digital i/o for the cRIO module.

    Any help would be greatly appreciated.

    The easiest way is to use the FPGA to get the time between the edges of your pulse increase (shift registers to maintain the current situation and the time will be necessary).  This will give you the period.  If it's a single pulse per turn, then the number of laps is just 60/T, where T is the time in seconds.

Maybe you are looking for

  • HP ProBook 4530 s: Wifi adapter driver

    Good night I reinstalled my OS System. Now, I try to attach to the wifi, but the wifi is not found, because he has not installed the appropriate driver. Please, could you send me a link or write me a driver name, that I must be installed in? Thanks f

  • Error when you join only on this server

    Error when you join only on this server

  • "impressions" are empty! Help me please!

    Whenever I try to rpint something, it comes out in white!  Do I leterally JUST changed the cartridges - what is happening? I'm so cunfused.

  • Windows 8 update does not restore backed up files

    Yesterday I when I joined PC it was just a white screen. I opted to update my windows 8 and had to back up my profile and files on an external hard drive (which took 2-3 hours) a then update the operating system. In the end, he informed me that he wa

  • How to reorganize the POV and the Page dimensions in a data form?

    version 11.1.2.3I have built my forms of data but want to rearrange the dimensions within the page selection while keeping my choices.  I can't drag and drop, right click and move up or change the section.  I can move upward members individual in a d