Copy link to clipboard
Copied
I have a variable I capture that has a resolution value which is a pixels/cm value. I then want to resize an image using that resolution variable and make sure the unit measurement is set to pixel/cm and make sure resampling is off so that it resizes 1:1.
I thought that:
imageResize(undefined,undefined,res.variable,ResampleMethod.None)
would be the right fit, but it is not. I tried using the scriptListener to grab those actions by doing it manually, but no luck. Can someone help?
I think you need to convert cm to pixels/inch
NewResolution = res.variable x 2.54
imageResize(undefined,undefined,NewResolution,ResampleMethod.NONE)
Copy link to clipboard
Copied
That would be a Crop not a resize. You need to discard part of you image to change its aspect ratio to 1:1 if its not square. You need to have some process to do that. ie. Make a centered crop or crop orientation from some corner. Or have an interactive action where you can position the 1:1 aspect crop selection for the action. It not hard to do.
Copy link to clipboard
Copied
You need to convert cm to pixels in the variable res.variable
Copy link to clipboard
Copied
I think you need to convert cm to pixels/inch
NewResolution = res.variable x 2.54
imageResize(undefined,undefined,NewResolution,ResampleMethod.NONE)
Copy link to clipboard
Copied
They want an images with a 1:1 Aspect Ratio. If they resize unconstrained to a 1:1 Aspect Ratio no matter what resolution the document has the image will distort. If they Crop the image to a 1:1 aspect ratio they will lose some image content the images resolution will not change. They could also add canvas so the image has a boarder to make the image have a 1:1 aspect ratio. They need to decide how the want to change the image to have a 1:1 aspect ratio. Add a Boarder, Crop, or Distort. Content Aware Scale also distorts the image but tries to preserve recognized objects aspect ratio their image looks like a unique finger print it will distort if resized to a 1:1 aspect ratio.
They do not want to Resample they must Crop or Add Canvas.
Copy link to clipboard
Copied
For anyone who comes along later on the thread. I don't want a 1:1 aspect ratio. I want a 1:1 image size. Specifically, I want to resize a fingerprint image with a ruler so that it's actually the size of the real fingerprint.
I thought that the Adjustment > Image Size modal popup would reflect the script's instructions to unchecked Resample and use pixel/cm selection but it did not. Adding the *2.54 to the script did the job as planned.