【ムービー・画像】吸い出そう 6【音声・BGM】at GAMEURAWAZA
【ムービー・画像】吸い出そう 6【音声・BGM】 - 暇つぶし2ch71:名無しさん@お腹いっぱい。
17/02/27 17:27:28.08 Opv+BWpZ.net
連投すみません。コードも貼り付けさせてください
import cv2
# colors.txt: Array<int>[765] <- 268_Sprite_0_12151977905946168902.txt
raw_ary = open('colors.txt').read().split('\n')
colors = []
for i in range(0, 255):
# colors.append(raw_ary[(i*3):(i*3)+3]) # 縦分割
colors.append([raw_ary[i], raw_ary[i+255], raw_ary[i+255+255]]) # 横分割
img = cv2.imread('texture2d/texture2d.png', cv2.IMREAD_UNCHANGED)
height, width = img.shape[:2]
for w in range(0, width):
for h in range(0, height):
index = img[h, w, 3] - 1
if index > -1:
# アルファ成分をindex番号にしてカラーパレットから抜き出す
# URLリンク(techblog.sega.jp)
img[h, w] = [colors[index][0], colors[index][1], colors[index][2], 0]
cv2.imshow('image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch