JPEG/JFIF supports a maximum image size of 65535×65535 pixels. Is there any reason why ImageMagick's montage limit the JPG output to 65500 instead of 65535?
1 Answer
ImageMagick uses libjpeg-turbo (http://sourceforge.net/projects/libjpeg-turbo) and the maximum dimensions are defined in the file jmorecfg.h. I could not find a good source why this value was chosen but according to the comment it was chosen to prevent an overflow.
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */