milizilla.blogg.se

2 pictures to gif morph
2 pictures to gif morph










2 pictures to gif morph

Actually, the desired end result of a 'morph' is usually to create an animation of the morph. (Allow the grid points on the outer edges to 'slide' along the edges, but not move 'inward' or 'outward'.)Ĥ) Provide the user a way to easily change the 2 grids to have a different number of 'segments' in the x and y directions.ĥ) Provide a 'scale' widget on the GUI by which the user can specify a 'morph factor' with which to make a single morph image - via a 'Do1MorphImg' button on the GUI.Ħ) The single morph image is mainly a way to check on the morph that may be created using the current deformation of the 2 grids. This utility is to center the 2 images in the canvases and determine a 'common overlay area' on the 2 images - and morph between the 'common overlay area' of the 2 images.)Ģ) Provide 2 side-by-side canvases on which to put the 2 images.ģ) Provide a grid of movable points on each image in each canvas - for the user to define the warp aspect of the 'morph'. (To make it easy on the user, my goal was to allow the 2 images to be of somewhat different sizes. My main goals for the 'wheeeMorph' Tcl-Tk script were:ġ) Provide a GUI for selecting a 2 image files (GIF, PNG, JPEG, or about 100 other types). See that wiki page above (#38676) for details on the barymetric mathematics involved and for further sources on barymetric coordinates and math. I used the same mathematics (and code) from that script to do the 'grid-warp' of the 'tkImageGridWarp' script - and I used the same mathematics in this 'wheeeMorph' script. On that color-shaded-isoceles-triangle page, I present a Tk script that peforms a color blend using barymetric coordinates.

2 PICTURES TO GIF MORPH CODE

The barymetric coordinates of a point in a triangle of the 'intermediate' grid (grid3) are calculated and then used to get the location of the corresponding point in the two corresponding triangles in the two user-deformed grids (grid1 and grid2).īack on 2013sep05, I posted code using a barymetric technique - at the wiki pageģ-Color-Gradient Isosceles Triangle - Barymetric Blend with Shaded Edges Like the 'tkImageGridWarp' script, this 'wheeeMorph' script works its way over QUADRANGLES - but on an 'intermediate' grid (grid3), a linear interpolation between 2 user-warped grids (3 warped grids involved) - not quadrangles on a single user-warped grid.įor a given point on the 'intermediate' grid, this utility finds the two corresponding pixels on grids 1 and 2 by using triangles (two triangles in each quadrangle) - by using 'barymetric coordinates' on each triangle. But instead of the 2 colors coming from 2 UNWARPED grids/images, the 2 colors had to come from 2 WARPED grids. The color-blending was more like the 'tkMerge2Images' script, in that 2 colors needed to be blended. In the color-blending, like in the warping, I encountered a major difference: Instead of getting the color for a pixel on the 'intermediate' grid from ONE image, I had to find the color of the TWO corresponding pixels on the TWO user-deformed grids (grid1 and grid2), and blend those two colors.

2 pictures to gif morph

Like the 'tkImageGridWarp' script, this 'wheeeMorph' script does the warping by doing a mapping onto a warped grid - BUT it is an 'intermediate' grid, between the 2 user-deformed grids - not a single warped grid. One of the big differences between my 'tkImageGridWarp' script and this 'wheeeMorph' script is that there are 2 grids (on 2 canvases) required, rather than 1 grid (on one canvas).Īlso, as I got into the development, I found that when I had the pointer positioned over a grid-point in one grid, I needed to provide a way to indicate the corresponding grid-point on the other grid.Īnd I kept finding new features (and procs) that I had to add as I did preliminary testing. But, as you will see in the images down this page, I managed to get some pretty good results. It took almost a man-month of work to make the utility. There were a lot more changes and additions than I had counted on. It turns out that it was more challenging than I thought. Since morphing is basically a combination of warping along with merging/blending 2 images, I knew that I could 'borrow' a lot of code from the 2 scripts above to make a morphing utility.

2 pictures to gif morph

I have had an image morphing utility on my Tcl-Tk 'to-do' list for about a year. TkImageGridWarp - GIF/PNG/JPEG/other - using a barymetric technique on triangles

2 pictures to gif morph

TkMerge2Images - GIF/PNG/JPEG - with image-weighting & image-alignment options I recently (2014mar) posted 2 image processing scripts on this wiki:












2 pictures to gif morph