-
-
Save hrehfeld/7f84a016e8acdb84e756a24b4113f6db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w_max = 2000 | |
w_export = 507 | |
export_ws = {} | |
# try all heights of crop rectangle | |
for w in range(w_export, w_max): | |
h = int(w * 2 / 3) | |
# now scale to export size with actual aspect ratio | |
h_export = int(w_export * h / w) | |
export_ws.setdefault(h_export, []) | |
export_ws[h_export].append(w) | |
for h in export_ws: | |
print('%s export height with these crop rectangle widths:\n %s...' % (h, export_ws[h][:10])) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment