2

I have made a Mandelbrot fractal generator (who hasn't, I know) which can render directly to disk to generate huge fractals.

My first test was a UHD 4k resolution which turned out great (8-bit colour for all of these examples). So I decided to go a little crazy and went 10x bigger in both dimensions, i.e. 38400 x 21600. The resulting file doesn't appear valid in that Photoshop can't open it but even looking at the file properties in Windows Explorer shows that the dimensions/etc are missing.

I thought there was a chance that the limits were 32768 so I tried to go just under that by doing a 30000 x 30000. This still seems to be invalid.

Going down to 10000 x 10000 works fine so I am wondering what the limitations are of the file format?

File size shouldn't be an issue as even the 10x4k resolution file was under 1GB.

Yu Hao
  • 119,891
  • 44
  • 235
  • 294
allanmb
  • 321
  • 3
  • 14
  • I just tried a 23040 x 4320 bitmap which would giev me an image to span my triple HD desktop with 2x AA and it works so the limit is somewhere between that and 30k x 30k – allanmb Jun 19 '15 at 15:11
  • This is going to depend on the limits of your image viewer (besides the header size fields), and the amount of memory you have available. An 8-bit image size 32000x32000 will require about 1Gbyte memory. – Weather Vane Jun 19 '15 at 17:14
  • I'm aware of that but there is a fundamental problem of the format which means the header is not being read correctly to report the file format. Anyway the machine I am using has 32GB so memory is not a problem. And the code used to write the bmp does it line-by-line so requires far less memory too. – allanmb Jun 19 '15 at 18:27
  • I've been playing with making 8-bit palette .bmp images. Size 16000 x 16000 was refused by MS Paint, but accepted by paint.net and a casual viewer (ULead supplied by a camera manufacturer). I just tried 32000 x 32000 which paint.net refused, and Ulead recognised (with the correct size), but would show only in thumbnail. Win7 with 4Gb. – Weather Vane Jun 19 '15 at 18:31
  • Interesting. I thought Photoshop would have opened just about anything that was valid. Do you have it to try with the 32k x 32k file? If it works, then there is possibly something wrong with my code writing the header. Out of interest, which version of bmpheader are you using? – allanmb Jun 19 '15 at 18:33
  • Not sure sorry, I know there are several, I just modified / replicated an old 160 X 160 8 bit image. The header parts are 54 bytes size and the palette 1024 bytes. – Weather Vane Jun 19 '15 at 18:35
  • Header does not contain a version num but field `bisize` is size 40. – Weather Vane Jun 19 '15 at 18:38
  • I think biSize of 40 bytes is the standard bitmap header which I am using. v4 and v5 are larger. – allanmb Jun 19 '15 at 19:12
  • Although I said I was using an old bitmap, that's incorrect. I converted an old 160x160 24-bit jpeg to an 8-bit bmp using paint.net. The 40 size is the second part of the header, the first part is size 14, total 54. I read in the bitmap, modified the the dimension and size fields, and wrote out the header, palette and replicated bitmap. – Weather Vane Jun 19 '15 at 19:15
  • Photoshop cannot open files that have more than 30000 pixel in any dimension. PS offers 3 format, if you are dealing with such large files, PSB, TIFF and RAW. – karatedog Jun 23 '15 at 20:18
  • See https://medium.com/@dcoetzee/maximum-resolution-of-bmp-image-file-8c729b3f833a#.p4dolik0x – Pacerier Dec 25 '16 at 03:11

3 Answers3

1

It looks the maximum size of BMP can be 32Kx32K and 2Gx2G pixels. Here is the link I found.. http://www.fileformat.info/format/bmp/egff.htm

  • Yeah I found that too but that is not what my tests are showing. As mentioned in my post above I tried 30k x 30k which doesnt work. – allanmb Jun 19 '15 at 15:10
  • Try the usuall -1 trick, make it 29999x29999 :-) or something much smaller, of course. – karatedog Jun 23 '15 at 20:18
1

I am not sure why, but the maximum dimensions for a Windows bitmap are 32768x32768 pixels. As I recall, they were actually developed before Windows 1.0. The first official document I remember seeing was after the Windows 3.1 release. They probably thought that was ridiculously large, at the time :) Both parameters are defined as DWORD's (32-bit integers). The width parameter is unsigned and the height parameter is signed (negative inverts the image).

Dave
  • 11
  • 1
0

limits should be the dword (32bit) entries in the header: at 0x02 filesize (maybe if you use compression: at 0x12 x-max, at 0x16 y-max)

(given that the entry at 0x22 data-bytes % 4 == 0)

I had a similar problem with a self-generated file: 24284 x 24464 Pixels (594.08 MPixels). Win10 file explorer did not show any size or depth, xnview, gimp, paint, ppt, internet-explorer, edge, chrome all did nothing.

firefox displayed the pic for a short time, but then switched to display a black box.

the only program which worked was irfanview.

(hope this is a valid answer now - as i seem not to be able to comment)

BerndSchmitt
  • 384
  • 3
  • 8
  • Technically this response is not an answer. Please consider reposting it as a comment either on the original question or the accepted answer. – Michael C. Jun 12 '18 at 20:01