• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Random Layers scale

Community Beginner ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

Hello everyone. I´m looking for a script/solution that will help me randomize layer scale within photoshop. I don´t need rotation/opacity or whatever, just scale each layer randomly.

 

Thanks a lot in advance

TOPICS
Actions and scripting

Views

937

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

Do you want the resize to be constrain. What kinds of layers. Do you want the resized layer to fit within the document's canvas? If the resized layers is smaller then canvas size but part of the layer is off canvas do you want the layer repositioned onto the canvas. If so how.  You have a lot of design work to do before you start coding. 

 

You will has a difficult job resizing smart object layer.  A smart object layer's object is not changed the results of the object being transformed is used as the smart object layers pixels and the Object transform setting are recorder into the smart object layers data. So the layer sized and the objects size may be very different.  The recorded transform may also be warping. distortion and positioning the object for he layers content use in the document.

 

If this is going to be your first script you may want to only random resize  normal image layer.  Each resize though will loose some image quality.  Its not a script that I would want or write.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

Hello!. i want the layers to be resized from 50% to 100%. Those are rasterized png layers. No need to bound within the canvas, could expand outside. Thanks a lot in advance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

LATEST

Then Transform with a  random Percent between 50 to 100. Should work. Set the same Percent for width and height Set set default interpolation to bicubic smoother.  Remember each transform will degrade the layer quality more. Its a destructive process and the layer's size will keep getting smaller.

 

 

var percentageChange = getRndInteger(50, 100);
activeDocument.activeLayer.resize(percentageChange,percentageChange,AnchorPosition.MIDDLECENTER);

//////////////////////////////////////////////////////////////////////////////////////////////////
function getRndInteger(min, max) {
    return Math.floor(Math.random() * (max - min) ) + min;
}

 

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines