Shaders don't work with pixels. Textures in shaders have x and y indices going from 0 to 1. In the shader, the function
texture samples the color of the texture given some coordinates in that range. If you have a 10x10 image, your PIXELS in range from 0 to 1 should have a 0.1x0.1 size, but the shader will also sample "smaller" indices like (0.05; 0.05). The sample value will be calculated according to the interpolation method you chose (nearest, linear).
So, Returning to the example.. if your image is 10x10, and you know that the pixel (0,0) is white, and the pixel (1,0) is black... then in the shader, the fragment in coordinates (0,0) should be white, and the fragment (0.1,0) corresponding to the seccond pixel, will be black, but the fragment between them (0.05,0) will also be sampled and will get a gray value (if linear interpolation is chosen).
Also, in your example, if the image is 10x10, the fragment at (0.5,0) will in fact be the pixel (5,0) of your image, so i can't tell what color it will have given the first and second pixel.
IDK if i'm making myself clear... what are you trying to achieve? Perhaps i can give you more info.