GIMP : 漫画の吹き出しを作成するスクリプトを利用する


  GIMP 環境




GIMP Portable | PortableApps.com - Portable software for USB drives

▼ 漫画の吹き出し (オリジナル)
http://linsovet.org.ua/files/balloon-v3.scm

▼ UTF-8N で保存
  

; balloon 
; creates a balloon like in comics
; it sucks a bit ;-)
; (C) Copyright 2000 by Michael Spunt <t0mcat@gmx.de>
; Gopal.V hacked it in 2002 to make it suck less (Aqua'ish)
; but cut a few corners (literally)
;
; ramok hacked it in 2006 to make colors

(define (round-balloon-3 img drawable bw bh lw rect np orientation revert fill border)
  (let* ((x 0))
    (if (= np FALSE) 
      (begin
        (set! x (- (* bw 0.5) (* bw 0.2)))
        (gimp-ellipse-select img x (* bh 0.5) (* bw 0.4) (* bh 0.4) REPLACE TRUE FALSE 0)
        (set! x (- (* bw 0.5) (* bw 0.2) (* bw orientation -0.1)))
        (gimp-ellipse-select img x (* bh 0.5) (* bw 0.4) (* bh 0.4) SUB TRUE FALSE 0)))
    (if (= revert FALSE) 
      (gimp-selection-translate img (* bw orientation 0.3) 0))
    (if (= rect FALSE) 
      (gimp-ellipse-select img (* bw 0.1) (* bh 0.1) (* bw 0.8) (* bh 0.65) ADD TRUE FALSE 0))
    (if (= rect TRUE) 
      (gimp-rect-select img (* bw 0.1) (* bh 0.1) (* bw 0.8) (* bh 0.65) ADD TRUE FALSE 0))
    (gimp-palette-set-background fill)
    (gimp-palette-set-foreground border) 
    (gimp-edit-fill drawable 0)
    (gimp-selection-shrink img lw)
    (gimp-edit-fill drawable 1)
;    (gimp-selection-none img)
;    (plug-in-gauss-rle2 1 img drawable 5.0 5.0)
;    (plug-in-bump-map 1 img drawable drawable 135 14 4 0 0 74 182 1 0 1)
))

(define (round-think-balloon-3 img drawable bw bh lw rect np orientation revert fill border)
  (let* ((x 0))
    (if (= np FALSE) 
      (begin
        (set! x (+ (* bw 0.5) (* bw -0.025) (* bw orientation 0.3)))
        (gimp-ellipse-select img x (* bh 0.85) (* bw 0.05) (* bh 0.05) REPLACE TRUE FALSE 0)
        (set! x (+ (* bw 0.5) (* bw -0.05) (* bw orientation 0.2)))
        (gimp-ellipse-select img x (* bh 0.75) (* bw 0.1) (* bh 0.1) ADD TRUE FALSE 0)))
    (if (= revert TRUE) 
      (gimp-selection-translate img (* orientation bw -0.3) 0))
    (if (= rect FALSE) 
      (gimp-ellipse-select img (* bw 0.1) (* bh 0.1) (* bw 0.8) (* bh 0.65) ADD TRUE FALSE 0))
    (if (= rect TRUE) 
      (gimp-rect-select img (* bw 0.1) (* bh 0.1) (* bw 0.8) (* bh 0.625) ADD TRUE FALSE 0))
    (gimp-palette-set-background fill)
    (gimp-palette-set-foreground border) 
    (gimp-edit-fill drawable 0)
    (gimp-selection-shrink img lw)
    (gimp-edit-fill drawable 1)
;    (gimp-selection-none img)
;    (plug-in-gauss-rle2 1 img drawable 5.0 5.0)
;    (plug-in-bump-map 1 img drawable drawable 135 14 4 0 0 74 182 1 0 1)
))

(define (script-fu-balloon-3 bw bh lw rect np think right revert fill border)
  (let* (
         (orientation 1)
         (side 1)
         (img (car (gimp-image-new bw bh RGB)))
         (balloon (car (gimp-layer-new img bw bh RGBA-IMAGE "Balloon3" 100 NORMAL))))
    (if (= right FALSE) (set! orientation -1))
    (gimp-image-add-layer img balloon 1)
    (gimp-display-new img)
    (gimp-edit-clear balloon)
    (if (= think FALSE) 
      (round-balloon-3 img balloon bw bh lw rect np orientation revert fill border))
    (if (= think TRUE) 
      (round-think-balloon-3 img balloon bw bh lw rect np orientation revert fill border))
    (gimp-selection-none img)
    (gimp-displays-flush)))

(script-fu-register "script-fu-balloon-3"
     "Balloon3..."
     "Creates a balloon like used in comics."
     "Michael Spunt"
     "Copyright 2000, Michael Spunt"
     "May 20, 2000"
     ""
     SF-ADJUSTMENT _"Image width"  '(240 10 2000 1 10 0 1)
     SF-ADJUSTMENT _"Image height" '(160 10 1000 1 10 0 1)
     SF-ADJUSTMENT "Line width"	   '(2 0 10 1 10 0 1)
     SF-TOGGLE "四角形"            FALSE
     SF-TOGGLE "吹き出しなし"	   FALSE
     SF-TOGGLE "妄想"              FALSE
     SF-TOGGLE "クチの向き(右)"  FALSE
     SF-TOGGLE "位置の反転"        FALSE
     SF-COLOR  "Fill"	            '(255 255 255)
     SF-COLOR  "Border"	            '(22 22 22))

(script-fu-menu-register "script-fu-balloon-3"
     "<Toolbox>/Xtns/Script-Fu/Text"
)
  



balloon.scm を 以下のディレクトリに作成します

GIMPPortable\App\gimp\share\gimp\2.0\scripts

その後、「フィルタ」=>「Script-Fu」=>「スクリプトを再読み込み」を選択します
すると、「フィルタ」=>「Script-Fu」=>「Text」=>「Balloon3」 で実行できます








  WEB カメラ で 吹き出し効果のテスト






出来上がった画像は、上記のようになり、背景が透過されています。
この画像を背景透過効果のあるままの png に保存して、以下の URL でロードして表示してみて下さい



WEB カメ くらぶ


WEB カメラの映像部分を画像の透過部分を通して見る事ができています。
このオンラインツールでは、3D 平面にもできるので、試してみて下さい
( 3D 表示は、右上のマーカーを WEB カメラで表示します )

Gimp_26_fukidashi_dialog_shot

▼ 3D 表示( 左側は球体化したもの )
Gimp_26_fukidashi_dialog_shot2

  JavaScript で吹き出し効果

以下はアマゾンの画像ですが、吹き出しは GIMP で作った画像で、テキストは普通のテキストです。
3つの部品を合成したものです。( これは、自前のライブラリで、IE6 でも動作します。)



  

<script type="text/javascript" src="http://winofsql.jp/lightbox_ie6png.js"></script>
<div style='position:relative;padding:5px;width:600px;'>
<a
	href="http://www.amazon.co.jp/exec/obidos/ASIN/B001L1S1OY/ginpro-22"
	target="_blank"
><img src="http://ecx.images-amazon.com/images/I/51MnRqZt1pL.jpg"
 galleryimg="no"
 border="1"
 style='border-color:#000000'
/></a>

<script type="text/javascript">
var ar = {
	url: "http://winofsql.jp/image/fd01.png",
	width: 150,
	height: 100,
	x: 300,
	y: 220
}
lightbox_ie6png.load(ar);
var ar = {
	text: "<b style='font-size:12px'>私、かなり天然</b>",
	x: 330,
	y: 269
}
lightbox_ie6png.loadtext(ar);
</script>

</div>
  



  JavaScript ライブラリ ( lightbox_ie6png.js ) のダウンロード

そのまま使ってもらってもいいのですが、ダウンロードもできます


ブラウザでダウンロード




yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  辞書  天気 


[gimp]
CCBot/2.0 (https://commoncrawl.org/faq/)
25/03/26 20:49:55
InfoBoard Version 1.00 : Language=Perl

1 BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube