'**SUMMARY**
Draw a grid on the image
**PARAMETERS**
* *dimensions* - No of rows and cols as an (rows,xols) tuple or list.
* *color* - Grid\'s color as a tuple or list.
* *width* - The grid line width in pixels.
* *antialias* - Draw an antialiased object
* *aplha* - The alpha blending for the object. If this value is -1 then the
layer default value is used. A value of 255 means opaque, while 0 means transparent.
**RETURNS**
Returns the index of the drawing layer of the grid
**EXAMPLE**
>>>> img = Image(\'something.png\')
>>>> img.grid([20,20],(255,0,0))
>>>> img.grid((20,20),(255,0,0),1,True,0)'

def grid(self, dimensions=(10, 10), color=(0, 0, 0), width=1, antialias=True, alpha=(-1)):

    retVal = self.copy()
    try:
        step_row = (self.size()[1] / dimensions[0])
        step_col = (self.size()[0] / dimensions[1])
    except ZeroDivisionError:
        return imgTemp
    i = 1
    j = 1
    grid = DrawingLayer(self.size())
    while ((i < dimensions[0]) and (j < dimensions[1])):
        if (i < dimensions[0]):
            grid.line((0, (step_row * i)), (self.size()[0], (step_row * i)), color, width, antialias, alpha)
            i = (i + 1)
        if (j < dimensions[1]):
            grid.line(((step_col * j), 0), ((step_col * j), self.size()[1]), color, width, antialias, alpha)
            j = (j + 1)
    retVal._gridLayer[0] = retVal.addDrawingLayer(grid)
    retVal._gridLayer[1] = dimensions
    return retVal
