If i use the nearest interpolation i get the right values but i dont know how can i make it work with a graphic