function stitched = stitch(filenames, X, Y)

r = stitch_channel(filenames, X, Y, 1);
g = stitch_channel(filenames, X, Y, 2);
b = stitch_channel(filenames, X, Y, 3);

stitched = uint8(cat(3, r, g, b));