generate canvas from image