Skip to main content
Participant
August 3, 2021
Pregunta

Use the Crop & Straighten, but don't crop.

  • August 3, 2021
  • 3 respuestas
  • 336 visualizaciones

Hey,

 

I very much want to use the automated straighten feature, sadly the crop cuts part of the image and it absolutely cannot... Is there a way to use it without cropping? I really can't understand why it wouldn't be an option to disable 1 or the other, surely it can't be sharing the same logic and would be pretty easy?

 

This feature would probably make quite a few people happy, and it would alleviate a huuuuuuge amount of time I waste straightening images manually or using the tool, but why do that if there's an automated one you guys already created?

Any help would be greatly appreciated!

Este tema ha sido cerrado para respuestas.

3 respuestas

Legend
August 3, 2021

Try this script (based on @r-bin  code from How to cut out photos )

#target photoshop
s2t = stringIDToTypeID;

try {
    var d = executeAction(stringIDToTypeID('CropPhotos0001'), undefined, DialogModes.NO);
    var l = d.getList(stringIDToTypeID('value'));
    var p = new Array();
    for (var i = 0; i < 8; i += 2) p.push([l.getDouble(i), l.getDouble(i + 1)]);
    var angle = - Math.atan2(p[1][1] - p[0][1], p[1][0] - p[0][0]) * 180 / Math.PI
    if (angle != 0) {
        if (activeDocument.activeLayer.isBackgroundLayer) executeAction(s2t('copyToLayer'), undefined, DialogModes.NO);
        (r = new ActionReference()).putEnumerated(s2t('layer'), s2t('ordinal'), s2t('targetEnum'));
        (d = new ActionDescriptor()).putReference(s2t('null'), r);
        d.putUnitDouble(s2t('angle'), s2t('angleUnit'), angle);
        executeAction(s2t('transform'), d, DialogModes.NO);
    }
}
catch (e) { alert(e); throw (e); }
Trevor.Dennis
Community Expert
Community Expert
August 3, 2021

Check Content Aware in the Options bar and extend the crop outside the image boundary.

 

Trevor.Dennis
Community Expert
Community Expert
August 3, 2021

If you don't like how Photoshop automatically fills in the missing pixels, another approach is to distort the image to fit the new document boundary with Free Transform.  If you have just a small are of transparent pixels then Free Transform > Warp will often work letting you pull a corner to fit the image to the frame.

 

You didn't mention Perspective Crop.  That can be used to automatically crop, straighten and square up an image to the frame.  I can't help but think the tools are already there. You just need to find them.

c.pfaffenbichler
Community Expert
Community Expert
August 3, 2021

This is primarily a user Forum, so you are not really addressing Adobe here, even though some Adobe employees thankfully have been dropping by.

If you want to post a Photoshop Feature Request please do so over on 

Photoshop Family