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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
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 */