The following should create a 50x50 image named /tmp/nopad.gif
with mostly random colors and a red border:
t1024 = Table[If[i==1 || i==50 || j==1 || j==50, {1,0,0}, RandomReal[1,3]],
{i, 1, 50}, {j, 1, 50}];
t1025 = Graphics[Raster[t1024], PlotRangePadding -> 0];
Export["/tmp/nopad.gif", t1025, ImageSize -> {50,50}]
It's hard to tell directly, but if you load the image into ImageMagick's display and use the magnify feature, you'll see a one pixel white border at the right and bottom edges:
Note that display counts starting at 0, so the highlighted white pixel is the 50th pixel in both the x and y directions.
As nearly as I can tell, setting ImageSize -> {51,51}
and then trimming the result is a workaround, but is there a better way to get rid of this border?
As a note, I realize I could've just loaded the image back into Mathematica to confirm it has a border, but, hopefully, the above is convincing enough.