タグ

PILに関するdarwiniaのブックマーク (3)

  • GitHub - uploadcare/pillow-simd: The friendly PIL fork

    There are multiple ways to tweak image processing performance. To name a few, such ways can be: utilizing better algorithms, optimizing existing implementations, using more processing power and/or resources. One of the great examples of using a more efficient algorithm is replacing a convolution-based Gaussian blur with a sequential-box one. Such examples are rather rare, though. It is also known,

    GitHub - uploadcare/pillow-simd: The friendly PIL fork
  • Python Image Library 説明

    元に戻る。 Python Imaging Library Overview PIL 1.1.3 | March 12, 2002 | Fredrik Lundh, Matthew Ellis Image Class 使用法: 始めにイメージサンプルへディレクトリを移動し、 Pythonを会話モードで作動する。 cd ~/Python/Imaging-1.1.3/Images python >>> Image Classを読み込む。 >>> import Image 画像lena.ppmを読み込み、imオブジェクトにする。 >>> im = Image.open("lena.ppm") 読み込みが成功すれば、画像形式、サイズ、カラーモードを 知ることができる。 >>> print im.format, im.size, im.mode PPM (128, 128) RGB 画像の表示はxv

  • PILでGBA with Python - 神様なんて信じない僕らのために

    PILを使った理想的な抽象化の例。 昔はわざわざ、BMPのstructureを定義したりして読んだりしましたよね。(遠い目) 必要なのはPython、そしてPILのインストール。 あとはfrom PIL import Imageです。 かなーり、適当なリストですが、いかに抽象化が素晴らしいか解るはずです。(こういう抽象化は賛成) 256色のBMPから、 GBAのRAWな16色パレットとキャラクタファイルを生成しています。 がgifでもなんでもいける筈ですよ。 hogeとか書いているところはreplaceして! かなり決めうちですが、自分で使うには十分。 スプライトアニメーションや、BGのアニメ、パレットアニメなど、 バイナリのデータ構造を考え、オリジナルフォーマットを書くのは面白いので是非。 image = Image.open(file('hoge.bmp')) t = image.co

    PILでGBA with Python - 神様なんて信じない僕らのために
  • 1