initial texture synthesis code