On Jul 31, 2010, at 9:36 PM, Robert Poland wrote:
I've got a challenge for the math-a-magicians out there.
Using the script below on a picture 3264x2448 i get a result in the display Dialog for 499 pixels.
THE CHALLENGE:
Is there a simple fix to get a result of 500 pixels?
No! Or, to put it another way, "Does 3264 contain 5 as a factor?"
If you factor 3264 completely, you get ...
3264 = 2^6 * 3^1 * 17
Scaling this to exactly one fifth its original size is impossible, since 5 is not a factor of 3264.
Your image software has to round 3264/500 = 6.528 ≈ 6.53 and 3264/6.53 = 499.84...
(And your image software does it differently than my example.)
If you want to scale EXACTLY, you have to ...
Scale-up by an integer value.
Scale-down by a (integer) factor of both dimensions.
Another example:
If your image measures 2749 x 5399 pixels,
you can never scale it down by any integer value, 1/n.
Why? Because both these numbers are primes!