perlin: various fixes, added demo image generation