Skip to main content
Participating Frequently
December 2, 2019
Resuelto

Accuracy of rotating images in Photoshop

  • December 2, 2019
  • 11 respuestas
  • 2770 visualizaciones

Hello,

I'm using Photoshop in my thesis and therefore I need to know how accurate Photoshop rotates images. For example if I tell Photoshop rotate my image 10 degrees, to which decimal place are the 10 degrees exact.

Thank you for your help!

 

{Thread renamed by moderator}

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Chuck Uebele

Okay, taking r-bin's suggestion to use a vector point rather than a pixel bounds point, I redid the script. Set up is pretty much as before, except no groups. just a straight line shape layer (2 points only), named "Orig." Duplicate that layer and leave the name as "Orig copy" then rotate that layer and run the script. It's much more accurate!

 

 

#target photoshop
var doc = activeDocument;

var origLay = doc.layers.getByName('Orig');
var moveLay = doc.layers.getByName('Orig copy');

doc.activeLayer = origLay;
var origPath = doc.pathItems[0].subPathItems[0];
var origPt = getNodes(origPath);

doc.activeLayer = moveLay;
var movePath = doc.pathItems[0].subPathItems[0];
var movePt = getNodes(movePath);

var ang1 = getAng (movePt[0][0], movePt[0][1], movePt[1][0], movePt[1][1])+270
var ang2 = getAng (origPt[0][0], origPt[0][1], origPt[1][0], origPt[1][1])+270
alert (ang2-ang1)


 function getAng(x1,y1,x2,y2,deg){
     
     var deltaX = x2-x1
     var deltaY = y2-y1
     var angGA = (Math.atan2 (deltaY, deltaX))*-180 /Math.PI

     return angGA
     }
 
 function getNodes(pth){
     var array = [];
    for(var i=0;i<pth.pathPoints.length;i++){
        array[i]=pth.pathPoints[i].anchor
        }  
    return array;
    }

 

 

11 respuestas

Sahil.Chawla
Adobe Employee
Adobe Employee
December 2, 2019

Hi Kim,

 

You can insert the degree on the options bar on the top, make sure that you have the image in Transform mod by hitting Ctrl (Win)/ CMD (macOS) + T on the keyboard.

 

Let us know how it goes.
Regards,
Sahil

Participating Frequently
December 2, 2019

Thank you for your answer. Unfortunately that doesn't help me, because I know how to rotate images. What I need to know is if I tipe in 10 degrees where you just described. To which decimal place the 10 degrees are accurate. For example if it's 10,0001 or 10,0000001 or if there is any other error.