gimpを使ってiconからpngに落とすScript-Fuを作ってみた。
icon2png
(define (convert-layer-file image filename tattoos idx)
(let*
(
(draw (car (gimp-image-get-layer-by-tattoo image (aref tattoos idx))))
(fn (string-append filename (number->string idx) ".png"))
(transparent (car (gimp-color-picker image draw 0 0 FALSE FALSE 0)))
)
(file-png-save RUN-NONINTERACTIVE
image
draw
fn
fn
0
9
0
0
0
0
0
)
(if (> idx 0)
(convert-layer-file image filename tattoos (- idx 1))
)
))
(define (icon2png filename colors)
(let*
(
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(tatooarr (gimp-image-get-layers image))
)
(if (> colors 0)
(gimp-convert-indexed image NO-DITHER MAKE-PALETTE colors TRUE FALSE ""))
(convert-layer-file image filename (cadr tatooarr) (- (car tatooarr) 1))
(gimp-image-delete image)
))
(icon2png "t.ico" 0)
(gimp-quit 0)
コマンド
cat icon2png | gimp -i -b -
[0回]
PR