Texture synthesis is the problem of taking a small input texture and generating an arbitrarially large amount of texture using it as a model. Two examples of this are:
There are many approaches to texture synthesis, and none work perfectly on all inputs. For example, the uniform structure on the cracker texture example has been lost. Almost all synthesis algorithms require some parameter tweaking to get really good results, and some do better if the user first annotates the input texture with extra information. I implemented several 2D texture synthesis algorithms for my undergraduate CS176 course at Caltech, however that code is very messy so it isn't going to get posted here until I rewrite it.
Texture Synthesis on Surfaces
You can also do texture synthesis on 3D surfaces, rather than just 2D images. In the example below, a stone texture was synthesized onto the gargoyle mesh:
An excellent approach to this problem is described in the Appearance-Space Texture Synthesis paper. My Design of Tangent Vector Fields paper uses this texture synthesis algorithm to visualize its vector fields; vector field design is an important prerequisite for texture synthesis on surfaces.
Several good texture synthesis references are:
Texture Analysis and Synthesis - Covers a pixel based approach that underlies lots of modern approaches.
Parallel Controllable Texture Synthesis - A combination of a lot of good ideas in texture synthesis, with a focus on making it run very quickly.
SIGGRAPH 2007 Course Notes - By far the best overview of state-of-the-art texture synthesis approaches I've found.
CS148 Lecture Slides - These are my texture synthesis lecture slides for CS148, however they're mostly just a summary of the course notes.