graphics
The Image MeshWarp Applet
|
This is an implementation of a meshwarping algorithm, using polygon scan conversion with texture
mapping to produce the warped image. On release of the mouse button after modifying the position of a vertex, the four affected polygons incident on the modified vertex are rendered with a relatively standard Bresenham incremental scanline conversion algorithm, using the initial fixed grid polygons of the image as textures to be mapped onto the new polygons. The algorithm is lossy, in that the texture mapping does not integrate areas of the source textures to produce pixel values. The texture mapping is also prone to distortion along the edges of adjacent polygons, which can produce unrealistic results. Vertex adjustments are reversible and idempotent.
Ultimately, it’s more toy than serious graphics tool…but fun nonetheless.
The Image Morphing Applet
|
This is an implementation of a peculiar triangular morphing algorithm. Starting with a source image, a destination image, and three control points for each image, I basically divide each image into a mesh of triangles, using the four corners and three control points as vertices. These triangles are then split into what I call simple triangles, which are triangles with one horizontal edge. This results in 14 triangles for each image. I then interpolate between each source/destination triangle pair to generate each frame of the morph; I do a triangular scanline conversion into the intermediate frame triangle, using the source and destination triangles as color sources and the frame number (as a fraction of the total number of frames) as an alpha transparency value for the sources. It’s not very fast, and not very robust, but with carefully selected images and control points it seems to work reasonably. Notice that the degree of morphing (the degree of pixel tranformation and motion versus pure transparent fade and replacement) is highest near the control points (which in this case are the eyes and nose of the people in the images), dropping to zero at the edges of the image.
The original source code for the Image Morphing Applet (from 1996, written for Java 1.0.2) can be found here.
Recent Posts
- Siri – a Shot Across Google’s Bow
- “Is colocation cheaper than using a cloud computing service to run the same workload?”
- “How Big is Amazon’s Cloud Computing Business?”
- “Android will run majority of smartphones by Spring”
- Amazon EC2 I/O Performance: Local Ephemeral Disks vs. RAID 0 Striped EBS Volumes
- “We create 5 exabytes every two days.”
- “Go Screw Yourself, Apple.”
- “You are not Google. (or: you don’t really need NoSQL…)”
- “The largest cloud providers are botnets.”
- Observed Performance of Amazon EC2 Instances
- Cloud Computing and Mobile Devices
- Time and Clock Issues in Windows-Based EC2 Instances
- My experimental local and real-time search engine is now available
- Entropy in Cloud Computing Applications
- How to Jailbreak iPhone 3.01