algorithm for drawing photos using straight lines