There are a few of these (or similar) on display at the San Francisco Exploratorium; well worth a visit if you've never been.
I made a simple RMagick script to generate these from animation frames. Turns out it even works well with full-color images. See: http://doormouse.org/illusion/ (interactivity only works in browsers that support the HTML5 range element)