17

This can be very broad, but let me just narrow it down. Assume that

  • Browser: Chrome Latest (Desktop)
  • Hardware: Windows Standard PC with default Intel Graphics card
  • Ram: 8GB
  • Processor: i7 @ 3.40 GHz

What is the maximum Width x Height I can support ?

If I try to put a 27150 x 20950 image into an <img> tag Chrome crashes.

So I want to know what the maximum width, height of an Image I can support.

Note: I have gone thru this post but its 8 years old

Edit 1: I am able to load a 160 Mb 4000 x 4000 px file so file size isnt a problem the 27150 x 20950 image is just 7 Mb. Compression isn't an option for me.

dota2pro
  • 7,220
  • 7
  • 44
  • 79
  • 1
    Not an answer but maybe a starting point for someone with time to dig: https://cs.chromium.org/chromium/src/ui/gfx/geometry/size.h?g=0&l=50 mentions checking if an image area will overflow. That would not happen for some image sizes that still aren't working but possibly there is some other factor involved as well that I did not find. – Daniel Aug 01 '19 at 23:16
  • @Daniel its related to Phaelax's answer i raised a bug [here](https://bugs.chromium.org/p/chromium/issues/detail?id=989044) – dota2pro Aug 01 '19 at 23:57

2 Answers2

7

According to one site I came across, maximum image size in Chrome 4 to 26 and Opera 8 was 8192x8192. Granted that's rather outdated as I'm currently running Chrome 75.

IE 5.5 to 10, FF 19, Opera 9-12 supported (Chrome wasn't specified) will support 16384x16384, which I was able to view a PNG of that size. I attempted 32768x32768 and larger, but it wouldn't display. Browser didn't crash, but all I got was a little white box outline in the center of the page.

I can attempt the larger images from home later to see what happens, as I have substantially more ram on my desktop (if that's a consideration).

Phaelax z
  • 1,814
  • 1
  • 7
  • 19
  • Wasn't a guess as I gave an exact image size that I was able to view and not able to view from a current browser. That sounds pretty relevant to me. – Phaelax z Jul 29 '19 at 17:41
  • That's an upper bound, not a definitive size. You also don't know if that's the case on every machine. – jhpratt Jul 29 '19 at 17:42
  • https://alexandre.alapetite.fr/doc-alex/large-image/index.en.html While loading the 16k PNG, it used about 2GB of ram during processing then settled at about 1GB (rough approximations). I've been trying to look through chromium's code tracker to to see if I can find a specific reference to a capped size limit but haven't come across anything current within the past 2 years. There were prior bugs mentioned about larger image sizes on the canvas but those have since been marked as fixed. – Phaelax z Jul 29 '19 at 18:27
1

After some testing on my personal machine (Chrome v91.0) using ImageMagik to resize an image a bunch of times, I collected the following results - all dimensions are wxh:

  • 65000 (ImageMajik maximum supported image dimension) x 8192 (19.5MB) - displayed
  • 65000 x 9000 (20.9MB) - not displayed
  • 8192 x 65000 (31.9MB) - displayed
  • 8292 x 65000 (32.7MB) - not displayed
  • 8292 x 8292 (7.1MB) - displayed
  • 16384 x 16384 (14.5MB) - displayed
  • 23150 x 23150 (23.1MB) - displayed
  • 23165 x 23165 (23.7.5MB) - aspect ratio displayed, but image loaded white
  • 23170 x 23170 (sqrt(2^29)) (23.8.5MB) - not displayed

So it seems the total size of the image must be less than 2^29 (539MP)

Barkles
  • 703
  • 9
  • 12