def round_to_integer(matrix, offset = 128):
    """returns 2D array with each element rounded to intergers"""
    
    intensity = []
    
    for i in range(len(matrix)):
        # Iterate through each row
        row = []
        
        for j in range(len(matrix[0])):
            # Iterate through each element in row
            row.append(round(matrix[i][j]) + offset)
        
        intensity.append(row)
    
    return intensity