I've just been asked to emulate it. And I was trying to figure what's behind the iPhoto slideshow pan/crop effect on oversized images. The same that has been now taken into the latest Nokia phones.

I am building a set of effects in a Flex-like manner (a series of classes that extend EventDispatcher and implement my own interface).

For such pan/dolly/crop effect I'm thinking maybe the following is a good process, given that I'm sure iPhoto doesn't have area of interest recognition, but uses randomness instead:

1: based on DisplayObject's and frame's (area of visualization) sizes, the script pre-computes 2 positions.
a) see-all, that maybe in-circled or out-circled based on the aspect ratio:
I) if the image is about a square, the position will be chosen so that it completely fills the area of visualization;
II) if the image is about an long rectangle, either horizontal or vertical, the position will be chosen so that most of it is shown within the area of visualization;
b) cropped-in, with random values for zoom and x/y position, within the image.

2: the script randomically decides whether to go from a to b, or from b to a.

3: the script moves, at the given pace (I would use total duration as an external parameter) from start point to end point with a linear motion (no accelerations).



From a logical point of view it all seems good. Can you see any flaws? Or (even better), do you know of anybody that hacked some cognitive software that estimates the area of interest of a picture, that I can port into AS3?


I will be happy to post the class as soon as it is ready, if anyone is interested.