2005-05-22から1日間の記事一覧

Pygameで画像処理7

これで最後。ネガ変換です。 import pygame _gSrc = None pygame.init() pygame.display.set_mode((150, 150), 0, 32) pygame.display.set_caption("ネガ変換") _gScr = pygame.display.get_surface() tBuf = pygame.image.load("kenmo.jpg").convert() # ネ…

Pygameで画像処理6

RGB成分入れ替えです。 import pygame _gSrc = None pygame.init() pygame.display.set_mode((150, 150), 0, 32) pygame.display.set_caption("RGB抽出") _gScr = pygame.display.get_surface() tBuf = pygame.image.load("kenmo.jpg").convert() # RGB抽出 …

Pygameで画像処理5

ノリノリです。RGB抽出を。 import pygame _gSrc = None pygame.init() pygame.display.set_mode((150, 150), 0, 32) pygame.display.set_caption("RGB抽出") _gScr = pygame.display.get_surface() tBuf = pygame.image.load("kenmo.jpg").convert() # RGB…

Pygameで画像処理4

続いて、2値変換を。 import pygame _gSrc = None pygame.init() pygame.display.set_mode((150, 150), 0, 32) pygame.display.set_caption("2値変換") _gScr = pygame.display.get_surface() tBuf = pygame.image.load("kenmo.jpg").convert() threshold …

Pygameで画像処理3

次にセピア変換を。 import pygame _gSrc = None pygame.init() pygame.display.set_mode((150, 150), 0, 32) pygame.display.set_caption("セピア変換") _gScr = pygame.display.get_surface() tBuf = pygame.image.load("kenmo.jpg").convert() # セピア変…

Pygameで画像処理2

ここからがホントの画像処理です。 で、超基本のグレースケールから、、。 import pygame _gSrc = None pygame.init() pygame.display.set_mode((150, 150), 0, 32) pygame.display.set_caption("グレースケール") _gScr = pygame.display.get_surface() tBu…

Pygameで画像処理1

画像処理でもなんでもない気がしますが…。 回転処理などを。 import pygame _gSrc = None # Image Ratation def drawRote(buf, x, y, angle): srcSize = tBuf.get_size() tmpBuf = pygame.transform.rotate(tBuf, angle) dstSize = tmpBuf.get_size() x -= (…

タスクシステム(基本編)

http://www5f.biglobe.ne.jp/~kenmo/program/task/task2/task2.html 「タスクシステム」って、ゲームプログラムの基本のわりには、 難しい言葉で書かれていることが多いから、できるだけ簡単に解説しました。 で、 なぜタスクシステムなのか? ゲームループ…