Highlighted

Random Layers scale

Community Beginner ,
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, How to

Views

54

Likes

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

Random Layers scale

Community Beginner ,
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, How to

Views

55

Likes

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
Aug 23, 2020 0
Most Valuable Participant ,
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

Likes

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
Reply
Loading...
Aug 23, 2020 0
Community Beginner ,
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

Likes

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
Reply
Loading...
Aug 23, 2020 0
JJMack LATEST
Most Valuable Participant ,
Aug 23, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Aug 23, 2020 0