# How to combine images with the same dimensions in a grid?

I have the following images, both 480 x 270 pixels:

I'd like to stitch them side by side in a 960 x 270 pixel image like so (scaled down):

So far, I've been using GraphicsGrid to try to achieve this:

c1 = Import["http://i.stack.imgur.com/2SRcD.png"];
c2 = Import["http://i.stack.imgur.com/zL8id.png"];
(* Frame parameter set here to emphasize next point. *)
g = GraphicsGrid[{{c1, c2}}, Frame -> True]


But there's padding between the images:

Additionally, it's scaled incorrectly, as ImageDimensions shows:

ImageDimensions@g

(* Expect {960, 540} *)
{360, 180}


I can use the ImageSize parameter to explicitly set the size of the output image, but that just reproduces the above result to scale.

How can combine the images side-by-side without scaling or padding?

-
My proxy/firewall won't let me Import the pictures, but isn't this a job for ImagePadding->None? –  Verbeia Jan 19 '12 at 3:47
@Verbeia ImagePadding -> None actually masks the entire image with a thick white border all around, cropping the images in half with the parts along the vertical center being exposed. –  casperOne Jan 19 '12 at 3:50
Try Grid instead of GraphicsGrid. I'm at work now so I can't really pursue this now, but GraphicsGrid enforces equal column widths, so this might be causing a problem. ImageAssemble is the neatest solution, but there are others. –  Verbeia Jan 19 '12 at 3:55

What you're looking for is ImageAssemble:

c1 = Import["http://i.stack.imgur.com/2SRcD.png"];
c2 = Import["http://i.stack.imgur.com/zL8id.png"];
ImageAssemble[{c1, c2}]


It can also assemble vertically and horizontally:

ImageAssemble[{{c1, c1}, {c2, c2}}]


-
As well as fleshing out the answer, I'm actually doing the 4x4, but displaying the NxN case is the best answer overall. –  casperOne Jan 19 '12 at 3:48

Incidentally, ImageDimensions on GraphicsGrid is behaving correctly. GraphicsGrid is generating an object with head Graphics, with a default width of 360 points, and the contents scaled down to fit. ImageDimensions then creates a bitmap version of the graphic, maintaining the size on screen, and returns the dimensions for that.

-