How do I get interpolated color value from an image

Edit: Nevermind. I figured it out.

I’m trying to get an interpolated pixel value from an image. For example, given an image loaded from a file, I want the RGB value from position (0.29, 0.79) where (0,0) is the bottom-left and (1,1) is the top-right. It looks like bpy.types.Texture.evaluate() will give me what I want but I’m getting unexpected results.

With my example code below, I pre-create a Texture with an Image already loaded. I set the Image color space to raw, uncheck Use Alpha, and set the Image Mapping extension to Clip. I’ve attached my test image below.

texture = bpy.data.textures[0]

pos = (0, 0, 0)
red, green, blue, intensity = texture.evaluate(pos)
print( '%s - red: %f, green: %f, blue: %f, intensity: %f' % (pos, red, green, blue, intensity))

pos = (0, 1, 0)
red, green, blue, intensity = texture.evaluate(pos)
print( '%s - red: %f, green: %f, blue: %f, intensity: %f' % (pos, red, green, blue, intensity))

pos = (1, 0, 0)
red, green, blue, intensity = texture.evaluate(pos)
print( '%s - red: %f, green: %f, blue: %f, intensity: %f' % (pos, red, green, blue, intensity))

pos = (1, 1, 0)
red, green, blue, intensity = texture.evaluate(pos)
print( '%s - red: %f, green: %f, blue: %f, intensity: %f' % (pos, red, green, blue, intensity))

This is what console shows:
(0, 0, 0) - red: 0.500000, green: 0.750000, blue: 0.500000, intensity: 1.000000
(0, 1, 0) - red: 0.500000, green: 0.500000, blue: 0.000000, intensity: 0.500000
(1, 0, 0) - red: 0.500000, green: 0.500000, blue: 0.500000, intensity: 0.500000
(1, 1, 0) - red: 1.000000, green: 0.000000, blue: 0.000000, intensity: 0.250000

As you can see, those values do not give me white, turquoise, or green. The only correct one is (1,1,0). I’ve tried changing other values like color space to sRGB and mapping to repeat, which gives me different results but are still not correct.

So how do I get an interpolated color value? Is bpy.types.Texture.evaluate() the wrong function?