I have tried out the following Pixel shader code to create a Mosaic Effect when a texture is applied for a simple rectangle. (Clamp U, V addressing and Linear Filtering is being used for the texture) :
Although the above 2 pixel shaders produce a Mosaic effect, a few lines having some random color appear along the edges of some rectangles (These lines can be clearly seen when a complex texture is applied to the rectangle and "- 2.0f" is uncommented in the last line in the pixel shader in order to produce a black frame).
The rendering is done using an ATI X700 graphics card. I even tried disabling mipmaps for the texture and using a texture having dimensions = some power of 2.But even that didn't solve the problem.