def get_pixels(image, zigzag=0):
	"""Return a list of pixel values for a greyscale image

	Keyword arguments:
	image -- PIL Image object converted to greyscale(L)
	zigzag -- flag to flatten pixels in zigzag manner"""

	pixel_values = list(image.getdata())
	pixels_itr = 0
	if zigzag == 1:
		pixels_itr = image.width
		while pixels_itr < len(pixel_values):
			pixel_values[pixels_itr : pixels_itr + image.width] \
			= (pixel_values[pixels_itr : pixels_itr + image.width][::-1])
			pixels_itr = pixels_itr + 2 * image.width
	return pixel_values