90 likes | 269 Views
Image Quilting and Texture Transfer. Max Morris & Mark Woulfe. Image Quilting - Theory.
E N D
Image Quilting and Texture Transfer Max Morris & Mark Woulfe
Image Quilting - Theory The idea behind image quilting is that you start with a fairly small image or texture and aim to create a larger seamless version of it. The application for this could be as simple as wanting to have a larger image to use on a digital art project, or programmatically to store textures as small images and then scale them to a larger size as and when needed (a scaled grass texture for terrain, or brick texture for a building).
Image Quilting - Implementation • We define a block to be 30% of the overall source image file; we use this block to create our new image. We seed the top left corner of our new texture with a random block from the source texture, after we get this we proceed in raster scan order to place blocks next to each other until we achieve a whole texture. • For each block we place, we find 1000 random blocks from the source image and test them against the previous block and its overlap, with the one with the lowest error value being saved and placed into the final texture. • We didn’t implement the minimum error boundary cut due to time constraints.
Texture Transfer - Theory The idea of Texture Transfer is taking a target image of a banana and a source texture of a lemon would result in a banana with the texture of the lemon. The applications of this seem fairly superficial but can lead to some pretty interesting and amusing results should you start using people’s faces as the target image.
Texture Transfer - Implementation • We used a similar looping structure to the one we had for the image quilting where it is going through 1,000 blocks of the source texture, however in this case we’re comparing the brightness of the pixels in each block. • The block from the source texture with the closest average brightness value to the one from the target image after 1,000 iterations is then chosen and placed in that location for the output texture. This is then repeated for the size of the output image and displayed to the user.
Summary • Even with leaving out the final stage of the image quilting we thought the results were quite good. • For the initial texture quilting, it helps to have some repeating features to the image. • Texture transfer is a little more tricky to get right, in cases where there is little colour variance, it is hard to map that onto another image that has much more colour content. • Further steps: • Implement the final stage of image quilting • Use a quilted texture and map it to a 3D object (Bricks to a building, grass to a 3D terrain)