![]() TYPICAL SEQUENCE OF OPERATIONS WITH THE GUI ![]() Note that there are two entry fields in which to set the parameters 'Nxsegs' and 'Nysegs' that control the 'fineness' of the grid.Īlso note that there are a couple of 'label' widgets across the middle of the GUI - one label for giving a brief guide on how to load an image to the canvas (with a grid) - and one 'status' label to allow for communicating to the user how the warp processing is going. ![]() On the basis of the goals above (and after many days of coding and testing - and re-designing and re-coding and re-testing - and almost giving up), I ended up with the GUI seen in the following image. So, in the code below, I have not included code to handle transparency information in either of those 2 types of image file.) (I am currently not concerned with handling transparency in GIF and PNG images. My main goals for the 'image warp' Tcl-Tk script were:ġ) Provide a GUI for selecting an image file (GIF, PNG, JPEG, or about 100 other types).Ģ) Provide a grid of movable points, for the user to define the warp.ģ) Provide the user a way to easily change the grid to have a different number of 'segments' in the x and y directions.Ĥ) Provide a way to easily hide the grid (points and lines), so that the warped image can be captured without the grid showing.ĥ) Devise the procs in the script in a modular fashion, so that essentially any operation can be done by the user, in almost any order, and reasonable results/responses will be obtained. See that wiki page above (#38676) for details on the barymetric mathematics involved and for further sources on barymetric coordinates and math. I knew that I could use similar mathematics to do the 'grid-warp' of a given image using 'barymetric coordinates' on triangles - to associate pixels in a 'moved triangle' to pixels in the corresponding, original, not-moved triangle (and the underlying, original image). On that color-shaded-isoceles-triangle page, I present a Tk script that peforms a color blend using barymetric coordinates. ![]() My intent was to use a rectangular grid but to do the 'color mapping' from the original image onto the warped grid via triangles in the rectangles - by using 'barymetric coordinates'.īack on 2013sep05, I posted code using a barymetric technique - at the wiki pageģ-Color-Gradient Isosceles Triangle - Barymetric Blend with Shaded Edges For about a year now (since about early-2013), I have had an 'image-warp-via-grid' item on my 'to-do' list - which is at the bottom of my 'bio' page at uniquename. ![]()
0 Comments
Leave a Reply. |