-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhiteboard.scm
73 lines (64 loc) · 2.65 KB
/
whiteboard.scm
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
;;; ホワイトボードの背景を白に統一
;;; https://github.com/halueda/white_board_sharpener
;;;
;;; Author: Haruyasu Ueda <[email protected]>
;;; Version 0.10
(define (white-board-sharp img layer)
(let ((using_layer nil))
(gimp-image-undo-group-start img)
;;・レイヤー>レイヤーをコピー
(set! using_layer (car (gimp-layer-copy layer 1)))
(gimp-image-add-layer img using_layer -1)
;;・フィルタ>ぼかし>ガウシアンぼかし200x200
(plug-in-gauss-iir2 1 img using_layer 200 200)
;;・レイヤーモードを除算
(gimp-layer-set-mode using_layer DIVIDE-MODE)
;;・レイヤー>画像の統合(レイヤー)
(gimp-image-merge-down img using_layer 0)
(set! using_layer (car (gimp-image-get-active-layer img)))
;;
;;・ツール>強調>アンシャープマスク 半径4 量1.4 閾値 8
(plug-in-unsharp-mask 1 img using_layer 4 1.4 8)
;; フィルタ>変形>レンズ補正
;; (plug-in-lens-distortion run-mode/INT32
;; image/IMAGE
;; drawable
;; offset-x/FLOAT
;; offset-y/FLOAT
;; main-adjust/FLOAT
;; edge-adjust/FLOAT
;; resacale/FLOAT
;; brighten/FLOAT)
(plug-in-lens-distortion 1 ;; run-mode/INT32 non-interactive =1
img ;; image
using_layer ;; drawable
0.0 ;; offset-x/FLOAT
0.0 ;; offset-y/FLOAT
-5.0 ;; main-adjust/FLOAT
0.0 ;; edge-adjust/FLOAT
0.0 ;; resacale/FLOAT
0.0) ;; brighten/FLOAT)
(gimp-image-undo-group-end img)
;;・色>明るさ-コントラストで、背景が荒れない程度にコントラストを極大・背景を白くつぶす
;; これは必要なら手動で。なくても十分OK。ここだけundoで戻せるようにする。
(gimp-brightness-contrast using_layer
-120 ;; inBrightness/INT
127 ;; inContrast/INT
)
(gimp-displays-flush)
)
)
(script-fu-register "white-board-sharp"
"<Image>/Script-Fu/White Board Sharpner..."
"Make background white and extra contrast for drawings."
"Haruyasu Ueda <[email protected]>"
"Haruyasu Ueda"
"2014"
"RGB*"
; ""
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable to apply" 0
;SF-ADJUSTMENT _"Mask size" '(5 1 100 1 1 0 1)
;SF-ADJUSTMENT _"Mask opacity" '(50 0 100 1 1 0 1)
; SF-ADJUSTMENT COMMENT '(default min max step_s step_l float_accur slider0_or_text1)
)