gfx.c for image tutorial