忍者ブログ
  • 2017.09
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 2017.11
icon2png
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 -
PR
【2012/11/24 15:06 】 | gimp | 有り難いご意見(0)
                                    
<<icon2png(改) | ホーム | なんとなく覚書>>
有り難いご意見
貴重なご意見の投稿














<<前ページ | ホーム | 次ページ>>