Brenhamís algorithm enables the selection of optimum raster locations to represent a straight line. In this algorithm either pixels along X or Y directions are incremented by one unit depending upon the slope of the line. The increment in the other direction is determined by examining the error or distance between actual line location and the nearest grid locations.