Skip to main content
Known Participant
June 12, 2019
Répondu

Photo Collage Toolkit - How to Automatically Scale Images to Cutouts

Hello,

I am trying to use JJMacks Photo Collage Toolkit.  I would like to know if there is a way to automatically scale the images to cutouts in the collage templates.  If anyone has accomplished this, please share some advice on how to go about it.  Thank you.

    Ce sujet a été fermé aux réponses.
    Meilleure réponse par JJMack

    The scripts in my toolkit will resize your images to fill the image areas in your Collage template they are being populated into.  The image composition in the collage will look like a centered aspect ratio crop that was resized to fill the image area in the collage.  Image that are populated into collage template should have aspect ratios that are close the the Aspect Ratio of the area that they will be places into.  Populating landscape images  into portrait area or a portrait images  into a landscape area will result in image composition that will be unacceptable for to much of you image content will be masked off.  You can populate any size image they will be resized for the collage image area.  However, for best results your Image should have the same Aspect ratio as the area they will be populated into.  They are your images and they are your templates make then work well together..

    2 commentaires

    JJMack
    Community Expert
    JJMackCommunity ExpertRéponse
    Community Expert
    June 13, 2019

    The scripts in my toolkit will resize your images to fill the image areas in your Collage template they are being populated into.  The image composition in the collage will look like a centered aspect ratio crop that was resized to fill the image area in the collage.  Image that are populated into collage template should have aspect ratios that are close the the Aspect Ratio of the area that they will be places into.  Populating landscape images  into portrait area or a portrait images  into a landscape area will result in image composition that will be unacceptable for to much of you image content will be masked off.  You can populate any size image they will be resized for the collage image area.  However, for best results your Image should have the same Aspect ratio as the area they will be populated into.  They are your images and they are your templates make then work well together..

    JJMack
    truematicAuteur
    Known Participant
    June 13, 2019

    Thanks for your reply.  I am moving portrait image on to a portrait cutout, but will further adjust the dimensions to see if I can get the desired resizing.  I also found a script on the forum that might work.  Will try it out in the next few days and report back.

    JJMack
    Community Expert
    Community Expert
    June 18, 2019

    I experimented with the dialog and options for the script that I am using the most, InteractivePopulateCollage:

    I could not change the logic in the script code to make the dialog checkbox of "fit image" behave the way I intended. 

    What I ended up doing is commenting out the original code and flipping the var percentageChange functions in this part of the script to accomplish what I need for now.  It works with my particular sets of images and scripts right now, but JJMack's suggestion would be much more elegant if I could get it to work.  Unfortunately, my coding knowledge is not up to that task, but I would be happy to try it if someone can share some pointers.

    Regardless, quite happy for the workaround and thankful for JJMack's PhotoCollageToolkit.  Plus, I learned how to paste this code snippet in a nice way(Advanced Editing - >> - Syntax Highlighting - Plain) .

    if (LWidth/LHeight<SWidth/SHeight) //{ // Smart Object layer Aspect Ratio less the Canvas area Aspect Ratio

    //var percentageChange = ((SWidth/LWidth)*100);  // Resize to canvas area width

    //activeDocument.activeLayer.resize(percentageChange,percentageChange,AnchorPosition.MIDDLECENTER);

    //}

    {

    var percentageChange = ((SHeight/LHeight)*100); // resize to canvas area height

    activeDocument.activeLayer.resize(percentageChange,percentageChange,AnchorPosition.MIDDLECENTER);

    }

    else //{

    //var percentageChange = ((SHeight/LHeight)*100); // resize to canvas area height

    //activeDocument.activeLayer.resize(percentageChange,percentageChange,AnchorPosition.MIDDLECENTER);

    //}

    { // Smart Object layer Aspect Ratio less the Canvas area Aspect Ratio

    var percentageChange = ((SWidth/LWidth)*100);  // Resize to canvas area width

    activeDocument.activeLayer.resize(percentageChange,percentageChange,AnchorPosition.MIDDLECENTER);

    }


    As I wrote it is not an option I would consider adding to my scripts. I do not like collage with partly filled image.  I outlined the code in red that does exactly what you want to do.  I also listed all the collage scripts you would need to change.  The you of course need to change all their dialog to add the fit image option then in the code test the option is not set fill the image are if set fit the image to the area however, What will be in the area depends on the template.  The code I posted. You would need  to use the variable names used the the current code for  filling the area. The script use different variable names then the code I posted from my mockup script you need  variable names used in the collage script an the test for  the fit image need to use  the correct dialog name the one for the scripts dialog. Each script uses a different dialog.

    JJMack
    Sahil.Chawla
    Adobe Employee
    Adobe Employee
    June 12, 2019

    Hi there,

    I am looping in JJMack, as he might be able to you out with this query.

    Regards,
    Sahil

    truematicAuteur
    Known Participant
    June 12, 2019

    Thank you for the pointer!  Hope he chimes in...