def apply_ray_effect(sun_image, setup) :
	canvas = setup['canvas']
	width, height = setup['canvas'][0], setup['canvas'][1]
	decay = 0.8
	density = 1.2
	samples = 128
	center = [ x / 2 for x in setup['canvas'] ]

	list_of_pixels = list(sun_image.getdata())

	new_image = []
	print("starting postprocessing...")
	for y in range(height) :
		print("\rjob completed {0:.2f}%".format(round(100 * (y / height), 2)), flush=True, end="")
		for x in range(width) :
			tc = [x, y]
			delta = [ (x - center[0]) / (samples * density), (y - center[1]) / (samples * density) ]
			color = list_of_pixels[x + y * width]
			illumination = 1
			for m in range(samples) :
				tc = [ tc[0] - delta[0], tc[1] - delta[1]]
				add_color = tuple( illumination * x for x in list_of_pixels[int(tc[0]) + int(tc[1]) * width] )
				illumination *= decay		
				color = tuple( x + y for x, y in zip(color, add_color))


			new_image.append(tuple(int(x) for x in color))


	image = Image.new(sun_image.mode, sun_image.size)
	image.putdata(new_image)
	return image