Skip to content

Instantly share code, notes, and snippets.

@misodengaku
Created December 20, 2012 12:49
Show Gist options
  • Save misodengaku/4345124 to your computer and use it in GitHub Desktop.
Save misodengaku/4345124 to your computer and use it in GitHub Desktop.
WGC.exeで変換したBMPをマージするスクリプト(HSP) 出力形式はBMP、「α値を強制除去」、「出力画像を上下反転」にチェックを入れて変換実行
#define offset_x 1195//差分画像の位置
#define offset_y 82//なぜ変数にしなかったか
picload "元"
buffer 1
picload "差分(目とか)"
x = ginfo_winx
y = ginfo_winy
screen 2//プレビュー用 bufferだのredrawだのお好きに
repeat x
c = cnt
repeat y
gsel 0
pget c + offset_x, cnt + offset_y
r1 = ginfo_r
g1 = ginfo_g
b1 = ginfo_b
gsel 1
pget c, cnt
r2 = ginfo_r
g2 = ginfo_g
b2 = ginfo_b
//1と2をRGBごとに比較して暗い方を使用(らしい)
if (r1 < r2):r = r1: else :r = r2
if (g1 < g2):g = g1: else :g = g2
if (b1 < b2):b = b1: else :b = b2
gsel 2
color r, g, b
pset c, cnt
loop
loop
gsel 0
color 255, 255, 255
gmode 4, x, y, 255
pos offset_x, offset_y
gcopy 2, 0, 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment