Image generation and processing