Texture Optimization for Example-based Synthesis