File: limits.rst

package info (click to toggle)
pillow 12.0.0-1
  • links: PTS
  • area: main
  • in suites: forky
  • size: 72,636 kB
  • sloc: python: 49,518; ansic: 38,787; makefile: 302; sh: 168; javascript: 85
file content (34 lines) | stat: -rw-r--r-- 965 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Limits
------

This page is documentation to the various fundamental size limits in
the Pillow implementation.

Internal limits
===============

* Image sizes cannot be negative. These are checked both in
  ``Storage.c`` and ``Image.py``

* Image sizes may be 0. (Although not in 3.4)

* Maximum pixel dimensions are limited to INT32, or 2^31 by the sizes
  in the image header.

* Individual allocations are limited to 2GB in ``Storage.c``

* The 2GB allocation puts an upper limit to the xsize of the image of
  either 2^31 for 'L' or 2^29 for 'RGB'

* Individual memory mapped segments are limited to 2GB in map.c based
  on the overflow checks. This requires that any memory mapped image
  is smaller than 2GB, as calculated by ``y*stride`` (so 2Gpx for 'L'
  images, and .5Gpx for 'RGB'

Format size limits
==================

* ICO: Max size is 256x256

* WebP: 16383x16383 (underlying library size limit:
  https://developers.google.com/speed/webp/docs/api)