27
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Pillowで扱える最大ピクセル数を増やす

Last updated at Posted at 2017-10-27

Pillowで高解像度データを処理していると

DecompressionBombWarning: Image size (166109750 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack.

画像サイズが限界値超えてるからDOS攻撃かもしれないよ的メッセージが。

この警告は出るものの処理自体はできるようだ。
また今回のプログラムはローカルで処理するものなので、DOS攻撃問題ナシ。
邪魔なので警告は消してしまおう。
メモリも64GB積んでいるので問題ナシ。

from PIL import Image

Image.MAX_IMAGE_PIXELS = 1000000000

私が処理できるピクセル数は10億です。
これで解決。

27
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
27
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?