Copy link to clipboard
Copied
Hi
I have been asked to produce some images for the Macy's website.
They have given dimensions of 1769px WIDTH and 2160px Height.
That is very clear but then they have asked for a FIXED ASPECT RATIO of 140:171.
I have no idea why that is needed or how it can be set. Can anyone help please?
thank you
Copy link to clipboard
Copied
Hello,
I'd use the crop tool to make sure you have a fixed ratio, you can learn more here: https://helpx.adobe.com/photoshop/using/crop-straighten-photos.html
Make sure to use this under the ratio option, and the you can input your size on the width and height bar.
Copy link to clipboard
Copied
Thanks for your reply. I understand what you have said.
But what I dont understand is when I use the aspect ratio they have supplied it changes the dimensions that they have specified?
Copy link to clipboard
Copied
"when I use the aspect ratio they have supplied it changes the dimensions"
No, it doesn't, not if you crop to ratio and not w x h in pixels.
1769:2160 is an aspect ratio of 140:171 (or to be very precise, 140:170.94). Just do the math.
Copy link to clipboard
Copied
Which math? Can you show the formula? Math is not my strong point, but if I can add it to my script...
The screenshots of my "Document Info" script below use 3 different aspect ratio formulas and none of them come out with a reported aspect ratio of 140:171 for a 1769 x 2160 px canvas.
#target photoshop
// https://stackoverflow.com/questions/1186414/whats-the-algorithm-to-calculate-aspect-ratio-i-need-an-output-like-43-169
var savedRuler = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
function gcd(a, b) {
return (b == 0) ? a : gcd(b, a % b);
}
var w = app.activeDocument.width.toString().replace(' px', '');
var h = app.activeDocument.height.toString().replace(' px', '');
var r = gcd(w, h);
var mp = w * h / 1000000
var pix = w * h
var ppiRes = app.activeDocument.resolution;
var ppcmRes = ppiRes/2.54
var ratio = w / h
var docName = app.activeDocument.name;
var wMetric = w / 72 * 2.54
var hMetric = h / 72 * 2.54
var wInches = w / 72
var hInches = h / 72
/////////////////////////////////////////////////////////////////////
var doc = app.activeDocument
var w = doc.width.toString().replace(' px', '');
var h = doc.height.toString().replace(' px', '');
function aspect_ratio(val, lim) {
var lower = [0, 1];
var upper = [1, 0];
while (true) {
var mediant = [lower[0] + upper[0], lower[1] + upper[1]];
if (val * mediant[1] > mediant[0]) {
if (lim < mediant[1]) {
return upper;
}
lower = mediant;
} else if (val * mediant[1] == mediant[0]) {
if (lim >= mediant[1]) {
return mediant;
}
if (lower[1] < upper[1]) {
return lower;
}
return upper;
} else {
if (lim < mediant[1]) {
return lower;
}
upper = mediant;
}
}
}
/////////////////////////////////////////////////////////////////////
app.preferences.rulerUnits = savedRuler;
alert('Document Info' + '\n' + 'Document Name: ' + docName + '\n' + 'Dimensions: ' + w + ' x ' + h + ' pixels' + '\n' + 'Dimensions: ' + Math.round(wMetric * 100) / 100 + ' x ' + Math.round(hMetric * 100) / 100 + ' cm / ' + Math.round(wInches * 1000) / 1000 + ' x ' + Math.round(hInches * 1000) / 1000 + ' inches' + '\n' + 'Resolution: ' + Math.round(ppiRes * 10) / 10 + ' ppi / ' + Math.round(ppcmRes * 1000) / 1000 + ' ppcm' + '\n' + 'Megapixel Value: ' + Math.round(mp * 10) / 10 + ' MP' + ' (' + pix + ' pixels)' + '\n' + 'Aspect Ratio:' + '\n' + ratio.toFixed(2) + ':1' + ' / ' + ratio.toFixed(2) * 2 + ':2 / ' + ratio.toFixed(2) * 4 + ':4' + ' (Basic)' + '\n' + w / r + ':' + h / r + ' (GCD)' + '\n' + aspect_ratio(w / h, 50).toString().replace(',', ':') + ' (Farey)');
Copy link to clipboard
Copied
Not mine either 😉 so I resorted to a workaround: divide to get the factor, 1769:140 = 12.6357. Then substitute: 2160:12.6357 = 170.94
I'm sure you can set up an equation with an x to get a number directly, just give me a minute..er...hmm...
Copy link to clipboard
Copied
There are different formulas for aspect ratio, so I'd stick with the explicit pixel dimensions quoted.
Copy link to clipboard
Copied
Thanks Stephen I am just going to stick to the pixels that must be correct. I cant really see why they have asked for the aspect ratio