-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetal-text.scm
1109 lines (997 loc) · 44.8 KB
/
metal-text.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; Metal Text rel 0.08
; Created by Graechan
; fix 2.10.22 by vitforlinux
;
; Thanks to Draconian for his great tutorials
; that inspired me to write this script.
; Comments directed to http://gimpchat.com or http://gimpscripts.com
;
; License: GPLv3
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; To view a copy of the GNU General Public License
; visit: http://www.gnu.org/licenses/gpl.html
;
;
; ------------
;| Change Log |
; ------------
; Rel 0.01 - Initial Release
; Rel 0.02 - Changed code to remove reliance on drawable Multiplication to provide 3D effect
; - Added pixal setting for 3D height
; Rel 0.03 - Added code to use the users default font Instead of my Menu's default if their system does not have it.
; - Thahkyou bkh1914 for the code to do this (saved me reinventing the wheel).
; - Added choice of either of the 3 of Draconians curves, Maximum, Medium or soft to create the metalic image.
; - Added a brightness control that effects the image.
; Rel 0.04 - Added additional Backgrounds,inluding a lomo-option and changed the text image to face different direction
; Rel 0.05 - Fixed bug when deselecting 3D Script fails "OOPS"
; Rel 0.06 - Added the Alpha Script to the file
; Rel 0.07 - Added additional settings and fixed bug in "Metal Finish Type" selection
; Rel 0.08 - Two fixes for gimp 2.10.22
;;;;
(define (script-fu-metal-alpha-to-logo image drawable
metal
polish
bright
tint-color
3d-effect
pixels
bkg-type
pattern
bkg-color
gradient
gradient-type-in
lomo
lomo-size
opacity
top
size
keep-selection-in
conserve)
(let* (
(image-layer (car (gimp-image-get-active-layer image)))
(final-width (car (gimp-image-width image)))
(final-height (car (gimp-image-height image)))
(width 0)
(height 0)
(alpha (car (gimp-drawable-has-alpha image-layer)))
(sel (car (gimp-selection-is-empty image)))
(layer-name (car (gimp-drawable-get-name image-layer)))
(img 0)
(activeLayer 0)
(original-layer 0)
(img-channel 0)
(bkg-layer 0)
(tint-layer 0)
(3d-layer 0)
(layers pixels)
(copy-layer 0)
(inc -1)
(offx inc)
(offy inc)
(brushName "outlineBrush")
(outline 4)
(vectors 0)
(shadow-size 8)
(shadow-opacity 50)
(size-layer 0)
(beam-height-in 0)
(grunge-layer 0)
(grunge-color bkg-color)
(random_gradient 0)
(gradient-type 0)
(name-string 0)
(gradient-type-name 0)
(gradient-type-blend 0)
(lomo-layer 0)
(metal-layer 0)
(keep-selection keep-selection-in)
)
(gimp-context-push)
(gimp-image-undo-group-start image)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))
(set! original-layer (car (gimp-layer-copy image-layer TRUE)))
(gimp-image-add-layer image original-layer 1)
(gimp-drawable-set-name original-layer "original-layer")
(if (= sel FALSE)
(begin
(gimp-selection-invert image)
(gimp-edit-clear original-layer)
(gimp-selection-invert image)))
(gimp-drawable-set-visible original-layer FALSE)
(gimp-image-scale-full image (* final-width 2) (* final-height 2) 2)
(set! width (car (gimp-image-width image)))
(set! height (car (gimp-image-height image)))
(if (= alpha FALSE) (gimp-layer-add-alpha image-layer))
;;;;check that a selection was made if not make one
(if (= sel TRUE) (set! keep-selection FALSE))
(if (= sel TRUE) (gimp-selection-layer-alpha image-layer))
;;;;set the image clolor to white
(gimp-context-set-foreground '(255 255 255))
(gimp-edit-fill image-layer FOREGROUND-FILL)
;;;;adjust the image size
(gimp-image-resize image (+ width (* pixels 2)) (+ height (* pixels 2)) 0 0)
(gimp-layer-resize-to-image-size image-layer)
(set! width (car (gimp-image-width image)))
(set! height (car (gimp-image-height image)))
;;;;save the selection
(gimp-selection-save image)
(set! img-channel (car (gimp-image-get-active-drawable image)))
(gimp-channel-set-opacity img-channel 100)
(gimp-drawable-set-name img-channel "img-channel")
(gimp-selection-none image)
;;;;blur the img-channel
(plug-in-gauss-rle2 RUN-NONINTERACTIVE image img-channel 10 10)
(gimp-image-set-active-layer image image-layer)
;;;;create the background layer
(set! bkg-layer (car (gimp-layer-new image width height RGBA-IMAGE "Background" 100 NORMAL-MODE)))
(gimp-image-add-layer image bkg-layer 1)
(gimp-image-set-active-layer image image-layer)
;;;;;;;;;;;;;;;;Main body of Script;;;;;;;;;;
(gimp-selection-load img-channel)
(gimp-edit-clear image-layer)
(plug-in-solid-noise RUN-NONINTERACTIVE image image-layer 0 0 0 1 5 5)
(plug-in-bump-map RUN-NONINTERACTIVE image image-layer img-channel 360 45 38 0 0 0 0 TRUE FALSE 0)
(if (= polish 0) (gimp-curves-spline image-layer 0 18 #(0 255 30 0 65 255 95 0 125 255 160 0 190 255 222 0 255 255)));max
(if (= polish 1) (gimp-curves-spline image-layer 0 14 #(0 0 31 193 79 30 127 255 191 94 222 255 255 185)));med
(if (= polish 2) (gimp-curves-spline image-layer 0 14 #(0 0 32 160 94 63 127 223 190 161 222 255 255 255)));soft
(gimp-brightness-contrast image-layer bright bright)
(gimp-selection-invert image)
(gimp-edit-clear image-layer)
(gimp-selection-invert image)
(if (= metal 1) (gimp-context-set-foreground '(255 215 0)));gold
(if (= metal 2) (gimp-context-set-foreground '(192 192 192)));silver
(if (= metal 3) (gimp-context-set-foreground '(250 180 150)));copper
(if (= metal 4) (gimp-context-set-foreground '(166 125 61)));bronze
(if (= metal 5) (gimp-context-set-foreground tint-color));colored tint
(if (> metal 0)
(begin
(set! tint-layer (car (gimp-layer-new image width height RGBA-IMAGE "Tint" 100 MULTIPLY-MODE)))
(gimp-image-add-layer image tint-layer (car (gimp-image-get-layer-position image image-layer)))
(gimp-edit-fill tint-layer FOREGROUND-FILL)
(gimp-selection-invert image)
(gimp-edit-clear tint-layer)
(set! image-layer (car (gimp-image-merge-down image tint-layer 0)))
)
)
(gimp-image-set-active-layer image image-layer)
(gimp-drawable-set-name image-layer "Image-layer")
(gimp-selection-none image)
;;;; define new brush for drawing operation
(gimp-brush-new brushName)
(gimp-brush-set-shape brushName BRUSH-GENERATED-CIRCLE)
(gimp-brush-set-spikes brushName 2)
(gimp-brush-set-hardness brushName 1.00)
(gimp-brush-set-aspect-ratio brushName 1.0)
(gimp-brush-set-angle brushName 0.0)
(gimp-brush-set-spacing brushName 1.0)
(gimp-brush-set-radius brushName outline)
(gimp-context-set-brush brushName)
(gimp-context-set-brush-default-size)
(gimp-context-set-foreground '(0 0 0))
;;;;create the 3d-layer
(if (= 3d-effect TRUE)
(begin
(gimp-image-resize image (+ width pixels) (+ height pixels) pixels pixels)
(gimp-layer-resize-to-image-size bkg-layer)
(gimp-layer-resize-to-image-size image-layer)
(set! 3d-layer (car (gimp-layer-copy image-layer TRUE)))
(gimp-image-add-layer image 3d-layer -1)
(gimp-drawable-set-name 3d-layer "3D Layer")
(while (> layers 0)
(set! copy-layer (car (gimp-layer-copy image-layer TRUE)))
(gimp-image-add-layer image copy-layer -1)
(gimp-layer-set-offsets copy-layer offx offy)
(if (= offx inc)
(begin
(gimp-selection-layer-alpha copy-layer)
(plug-in-sel2path 1 image copy-layer)
(gimp-selection-none image)
(set! vectors (car (gimp-image-get-active-vectors image)))
(gimp-edit-stroke-vectors copy-layer vectors)
(gimp-image-remove-vectors image vectors)))
(set! 3d-layer (car (gimp-image-merge-down image copy-layer CLIP-TO-IMAGE)))
(set! layers (- layers 1))
(set! offx (+ offx inc))
(set! offy (+ offy inc))
)
(gimp-layer-set-offsets 3d-layer pixels pixels)
(gimp-image-raise-layer-to-top image image-layer)
(set! 3d-layer (car (gimp-image-merge-down image image-layer 0)))
(gimp-drawable-set-name 3d-layer (string-append layer-name "-3D"))
)
)
(gimp-brush-delete brushName)
(gimp-displays-flush)
;;;;Scale Image to it's original size and apply the text Shine
(gimp-image-scale-full image final-width final-height 2)
(set! width (car (gimp-image-width image)))
(set! height (car (gimp-image-height image)))
(set! 3d-layer (car (gimp-image-get-active-layer image)))
(if (= 3d-effect FALSE) (gimp-drawable-set-name 3d-layer layer-name))
(the-metal-text-shine image 3d-layer shadow-size shadow-opacity FALSE)
;;;;fill the background layer
(gimp-layer-resize bkg-layer (+ width (* (/ width 100) 40)) (+ height (* (/ height 100) 40)) (* (/ width 100) 20) (* (/ height 100) 20))
(gimp-image-resize-to-layers image)
(if (= bkg-type 0)
(begin
(set! 3d-layer (car (gimp-image-get-active-layer image)))
(gimp-image-lower-layer image 3d-layer)
(set! size-layer (car (gimp-layer-copy 3d-layer TRUE)))
(gimp-image-add-layer image size-layer -1)
(plug-in-autocrop-layer 1 image size-layer)
(set! beam-height-in (car (gimp-drawable-height size-layer)))
(gimp-image-remove-layer image size-layer)
(gimp-drawable-set-visible 3d-layer FALSE)
(gimp-image-set-active-layer image bkg-layer)
(the-background-light&waves image bkg-layer beam-height-in 10 "Incandescent" TRUE 50 conserve)
(set! bkg-layer (car (gimp-image-merge-visible-layers image 0)))
(gimp-image-lower-layer image bkg-layer)
(gimp-drawable-set-name bkg-layer "Light&Waves")
(gimp-drawable-set-visible 3d-layer TRUE)))
(if (= bkg-type 1)
(begin
(gimp-image-set-active-layer image bkg-layer)
(the-metal-text-grunge-bkg image bkg-layer grunge-color 100 TRUE TRUE) ;grunge-color
(set! grunge-layer (car (gimp-image-get-active-layer image)))
(set! bkg-layer (car (gimp-image-merge-down image grunge-layer EXPAND-AS-NECESSARY)))
(gimp-drawable-set-name bkg-layer "Grunge")))
(gimp-context-set-pattern pattern)
(gimp-context-set-background bkg-color)
(gimp-context-set-gradient gradient)
(if (= bkg-type 2)
(begin
(gimp-drawable-fill bkg-layer PATTERN-FILL)
(gimp-drawable-set-name bkg-layer (string-append (car (gimp-drawable-get-name bkg-layer)) "_pattern" "_" pattern))))
(if (= bkg-type 3)
(begin
(gimp-drawable-fill bkg-layer BACKGROUND-FILL)
(gimp-drawable-set-name bkg-layer (string-append (car (gimp-drawable-get-name bkg-layer)) "_color"))))
(if (= bkg-type 4)
(begin
(gimp-selection-none image)
(gimp-drawable-fill bkg-layer BACKGROUND-FILL)
(set! gradient-type-blend
(cond
(( equal? gradient-type-in 0 ) GRADIENT-SHAPEBURST-ANGULAR)
(( equal? gradient-type-in 1 ) GRADIENT-SHAPEBURST-SPHERICAL)
(( equal? gradient-type-in 2 ) GRADIENT-SHAPEBURST-DIMPLED)))
(set! gradient-type-name
(cond
(( equal? gradient-type-in 0 ) "GRADIENT-SHAPEBURST-ANGULAR")
(( equal? gradient-type-in 1 ) "GRADIENT-SHAPEBURST-SPHERICAL")
(( equal? gradient-type-in 2 ) "GRADIENT-SHAPEBURST-DIMPLED")))
(gimp-edit-blend bkg-layer CUSTOM-MODE NORMAL-MODE gradient-type-blend 100 0 REPEAT-NONE FALSE FALSE 3 0.2 TRUE 0 0 width height)
(gimp-drawable-set-name bkg-layer (string-append gradient "_" gradient-type-name))))
;;;;create the random gradients
(if (= bkg-type 5)
(begin
(gimp-selection-none image)
(gimp-drawable-fill bkg-layer BACKGROUND-FILL)
(set! random_gradient (list-ref (cadr (gimp-gradients-get-list "")) (round (random (car (gimp-gradients-get-list ""))))))
(set! gradient-type (+ 6 (random 3)))
(gimp-context-set-gradient random_gradient)
(gimp-edit-blend bkg-layer CUSTOM-MODE NORMAL-MODE gradient-type 100 0 REPEAT-NONE FALSE FALSE 3 0.2 TRUE 0 0 width height)
(set! gradient-type-name
(cond
(( equal? gradient-type 6 ) "GRADIENT-SHAPEBURST-ANGULAR")
(( equal? gradient-type 7 ) "GRADIENT-SHAPEBURST-SPHERICAL")
(( equal? gradient-type 8 ) "GRADIENT-SHAPEBURST-DIMPLED")))
(set! name-string (string-append (car (gimp-drawable-get-name bkg-layer)) "- Gradient " random_gradient "- Shape " gradient-type-name))
(gimp-drawable-set-name bkg-layer name-string)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))))
(if (= size TRUE) (gimp-image-scale-full image final-width final-height 2))
;;;;add the lomo to bkg
(if (and (= lomo TRUE) (> bkg-type 0))
(begin
(if (= bkg-type 6)
(begin
(gimp-context-set-background '(255 255 255))
(gimp-drawable-fill bkg-layer BACKGROUND-FILL)))
(gimp-selection-load img-channel)
(gimp-image-set-active-layer image bkg-layer)
(the-metal-text-lomo image (car (gimp-image-get-active-layer image)) lomo-size opacity FALSE TRUE)
(set! lomo-layer (car (gimp-image-get-active-layer image)))
(gimp-layer-set-opacity lomo-layer opacity)
(if (and (< bkg-type 6) (> bkg-type 0)) (plug-in-colortoalpha 1 image lomo-layer '(255 255 255)))
(if (= bkg-type 6)
(begin
(set! bkg-layer (car (gimp-image-merge-down image lomo-layer EXPAND-AS-NECESSARY)))
(plug-in-colortoalpha 1 image bkg-layer '(255 255 255))))
))
(gimp-image-resize-to-layers image)
(if (= keep-selection TRUE) (gimp-selection-load img-channel))
(if (= top TRUE) (gimp-image-raise-item-to-top image original-layer))
(gimp-drawable-set-visible original-layer TRUE)
(if (= conserve FALSE)
(begin
(set! metal-layer (car (gimp-image-merge-visible-layers image 0)))
(gimp-drawable-set-name metal-layer layer-name)
(if (= 3d-effect TRUE) (gimp-drawable-set-name metal-layer (string-append layer-name "-3D")))
(gimp-image-remove-channel image img-channel)
))
(if (= bkg-type 5)
(begin
(set! name-string (string-append (car (gimp-drawable-get-name metal-layer)) "- Gradient= " random_gradient "- Shape " gradient-type-name))
(gimp-drawable-set-name metal-layer name-string)))
(gimp-displays-flush)
(gimp-image-undo-group-end image)
(gimp-context-pop)
)
)
(script-fu-register "script-fu-metal-alpha-to-logo"
"Metal Alpha"
"Rel6-Create a Metalic Image over a Background layer."
"Graechan"
"Graechan - http://gimpchat.com"
"Oct 2012"
"RGB*"
SF-IMAGE "image" 0
SF-DRAWABLE "drawable" 0
SF-OPTION "Metal Finish Type" '("Chrome" "Gold" "Silver" "Copper" "Bronze" "Colored Tint")
SF-OPTION "Metal Finish polish" '("Maximum" "Medium" "Soft")
SF-ADJUSTMENT "Brightness" '(50 0 100 1 10 0 0)
SF-COLOR "Tint Color" '(0 0 255)
SF-TOGGLE "Add a 3D Effect" TRUE
SF-ADJUSTMENT "3D Height (pixels)" '(30 1 100 1 10 0 0)
SF-OPTION "Background Type" '("Starlight" "Grunge" "Pattern" "Color" "Gradient" "Random Gradient" "None")
SF-PATTERN "Pattern" "Pink Marble"
SF-COLOR "Background and Grunge color" '(153 153 153)
SF-GRADIENT "Background Gradient" "Horizon 2"
SF-OPTION "Gradient Shape if Bkg-type=gradient" '("GRADIENT-SHAPEBURST-ANGULAR" "GRADIENT-SHAPEBURST-SPHERICAL" "GRADIENT-SHAPEBURST-DIMPLED")
SF-TOGGLE "Add Lomo to Background" FALSE
SF-ADJUSTMENT "Lomo Size" '(0 0 200 1 10 0 0)
SF-ADJUSTMENT "Lomo Opacity" '(80 0 100 1 10 0 0)
SF-TOGGLE "Place Original Image on Top" FALSE
SF-TOGGLE "Keep Original Alpha or Selection Size" FALSE
SF-TOGGLE "Keep selection" FALSE
SF-TOGGLE "Keep the Layers" FALSE
)
(script-fu-menu-register "script-fu-metal-alpha-to-logo" "<Image>/Script-Fu/Alpha-to-Logo/")
(define (script-fu-metal-text
text
justify
letter-spacing
line-spacing
font-in
size
metal
polish
bright
tint-color
3d-effect
pixels
bkg-type
pattern
bkg-color
gradient
gradient-type-in
lomo
lomo-size
opacity
conserve)
(let* (
(image (car (gimp-image-new 256 256 RGB)))
(border (/ size 3))
(font (if (> (string-length font-in) 0) font-in (car (gimp-context-get-font))))
(size-layer (car (gimp-text-fontname image -1 0 0 text border TRUE size PIXELS font)))
(final-width (car (gimp-drawable-width size-layer)))
(final-height (car (gimp-drawable-height size-layer)))
(text-layer 0)
(width 0)
(height 0)
(bkg-layer 0)
(img-channel 0)
(tint-layer 0)
(metal-text-layer 0)
(3d-layer 0)
(layers pixels)
(copy-layer 0)
(inc -1)
(offx inc)
(offy inc)
(brushName "outlineBrush")
(outline 4)
(vectors 0)
(shadow-size 8)
(shadow-opacity 50)
(beam-height-in 0)
(random_gradient 0)
(gradient-type 8)
(grunge-layer 0)
(grunge-color bkg-color)
(name-string 0)
(gradient-type-name 0)
(gradient-type-blend 0)
(lomo-layer 0)
(justify (cond ((= justify 0) 2)
((= justify 1) 0)
((= justify 2) 1)))
)
(gimp-context-push)
;;;;Adjust the text on size-layer
(gimp-text-layer-set-justification size-layer justify)
(gimp-text-layer-set-letter-spacing size-layer letter-spacing)
(gimp-text-layer-set-line-spacing size-layer line-spacing)
(set! final-width (car (gimp-drawable-width size-layer)))
(set! final-height (car (gimp-drawable-height size-layer)))
;;;;Add the text layer for a temporary larger Image size
(set! text-layer (car (gimp-text-fontname image -1 0 0 text (round (/ 632 3)) TRUE 632 PIXELS font)))
(gimp-text-layer-set-justification text-layer justify)
(gimp-text-layer-set-letter-spacing text-layer letter-spacing)
(gimp-text-layer-set-line-spacing text-layer line-spacing)
(set! width (car (gimp-drawable-width text-layer)))
(set! height (car (gimp-drawable-height text-layer)))
(gimp-image-remove-layer image size-layer)
(gimp-image-resize-to-layers image)
;;;;set the text clolor to white
(gimp-context-set-foreground '(255 255 255))
(gimp-selection-layer-alpha text-layer)
(gimp-edit-fill text-layer FOREGROUND-FILL)
;;;;save the selection
(gimp-selection-save image)
(set! img-channel (car (gimp-image-get-active-drawable image)))
(gimp-channel-set-opacity img-channel 100)
(gimp-drawable-set-name img-channel "img-channel")
(gimp-selection-none image)
;;;;blur the img-channel
(plug-in-gauss-rle2 RUN-NONINTERACTIVE image img-channel 10 10)
(gimp-image-set-active-layer image text-layer)
;;;;resize the text-layer
(gimp-image-set-active-layer image text-layer)
(gimp-layer-resize-to-image-size text-layer)
;;;;;;;;;;;;Main body of Script;;;;;;;;;;
;;;;create the background layer
(set! bkg-layer (car (gimp-layer-new image width height RGBA-IMAGE "Background" 100 NORMAL-MODE)))
(gimp-image-add-layer image bkg-layer 1)
(gimp-image-set-active-layer image text-layer)
(gimp-selection-load img-channel)
(gimp-edit-clear text-layer)
(plug-in-solid-noise RUN-NONINTERACTIVE image text-layer 0 0 0 1 5 5)
(plug-in-bump-map RUN-NONINTERACTIVE image text-layer img-channel 360 45 38 0 0 0 0 TRUE FALSE 0)
(if (= polish 0) (gimp-curves-spline text-layer 0 18 #(0 255 30 0 65 255 95 0 125 255 160 0 190 255 222 0 255 255)));max
(if (= polish 1) (gimp-curves-spline text-layer 0 14 #(0 0 31 193 79 30 127 255 191 94 222 255 255 185)));med
(if (= polish 2) (gimp-curves-spline text-layer 0 14 #(0 0 32 160 94 63 127 223 190 161 222 255 255 255)));soft
(gimp-brightness-contrast text-layer bright bright)
(gimp-selection-invert image)
(gimp-edit-clear text-layer)
(gimp-selection-invert image)
(if (= metal 1) (gimp-context-set-foreground '(255 215 0)));gold
(if (= metal 2) (gimp-context-set-foreground '(192 192 192)));silver
(if (= metal 3) (gimp-context-set-foreground '(250 180 150)));copper
(if (= metal 4) (gimp-context-set-foreground '(166 125 61)));bronze
(if (= metal 5) (gimp-context-set-foreground tint-color));colored tint
(if (> metal 0)
(begin
(set! tint-layer (car (gimp-layer-new image width height RGBA-IMAGE "Tint" 100 MULTIPLY-MODE)))
(gimp-image-add-layer image tint-layer (car (gimp-image-get-layer-position image text-layer)))
(gimp-edit-fill tint-layer FOREGROUND-FILL)
(gimp-selection-invert image)
(gimp-edit-clear tint-layer)
(set! text-layer (car (gimp-image-merge-down image tint-layer CLIP-TO-IMAGE)))
)
)
(gimp-drawable-set-name text-layer "Text Layer")
(gimp-selection-none image)
;;;; define new brush for drawing operation
(gimp-brush-new brushName)
(gimp-brush-set-shape brushName BRUSH-GENERATED-CIRCLE)
(gimp-brush-set-spikes brushName 2)
(gimp-brush-set-hardness brushName 1.00)
(gimp-brush-set-aspect-ratio brushName 1.0)
(gimp-brush-set-angle brushName 0.0)
(gimp-brush-set-spacing brushName 1.0)
(gimp-brush-set-radius brushName outline)
(gimp-context-set-brush brushName)
(gimp-context-set-brush-default-size)
(gimp-context-set-foreground '(0 0 0))
;;;;create the 3d-layer
(if (= 3d-effect TRUE)
(begin
(set! 3d-layer (car (gimp-layer-copy text-layer TRUE)))
(gimp-image-add-layer image 3d-layer -1)
(gimp-drawable-set-name 3d-layer "3D Layer")
(while (> layers 0)
(set! copy-layer (car (gimp-layer-copy text-layer TRUE)))
(gimp-image-add-layer image copy-layer -1)
(gimp-layer-set-offsets copy-layer offx offy)
(if (= offx inc)
(begin
(gimp-selection-layer-alpha copy-layer)
(plug-in-sel2path 1 image copy-layer)
(gimp-selection-none image)
(set! vectors (car (gimp-image-get-active-vectors image)))
(gimp-edit-stroke-vectors copy-layer vectors)
(gimp-image-remove-vectors image vectors)))
(set! 3d-layer (car (gimp-image-merge-down image copy-layer CLIP-TO-IMAGE)))
(set! layers (- layers 1))
(set! offx (+ offx inc))
(set! offy (+ offy inc))
)
(gimp-layer-set-offsets 3d-layer pixels pixels)
(gimp-image-raise-layer-to-top image text-layer)
(set! 3d-layer (car (gimp-image-merge-down image text-layer 0)))
(gimp-drawable-set-name 3d-layer (string-append text "-3D"))
)
)
(gimp-brush-delete brushName)
;;;;Scale Image to it's original size and apply the text Shine
(gimp-image-scale-full image final-width final-height 2)
(set! width (car (gimp-image-width image)))
(set! height (car (gimp-image-height image)))
(set! 3d-layer (car (gimp-image-get-active-layer image)))
(if (= 3d-effect FALSE) (gimp-drawable-set-name 3d-layer text))
(the-metal-text-shine image 3d-layer shadow-size shadow-opacity FALSE)
;;;;fill the background layer
(if (= bkg-type 0)
(begin
(set! 3d-layer (car (gimp-image-get-active-layer image)))
(gimp-image-lower-layer image 3d-layer)
(set! size-layer (car (gimp-layer-copy 3d-layer TRUE)))
(gimp-image-add-layer image size-layer -1)
(plug-in-autocrop-layer 1 image size-layer)
(set! beam-height-in (car (gimp-drawable-height size-layer)))
(gimp-image-remove-layer image size-layer)
(gimp-drawable-set-visible 3d-layer FALSE)
(gimp-image-set-active-layer image bkg-layer)
(the-background-light&waves image bkg-layer beam-height-in 10 "Incandescent" TRUE 50 conserve)
(set! bkg-layer (car (gimp-image-merge-visible-layers image 0)))
(gimp-image-lower-layer image bkg-layer)
(gimp-drawable-set-name bkg-layer "Light&Waves")
(gimp-drawable-set-visible 3d-layer TRUE)))
(if (= bkg-type 1)
(begin
(gimp-image-set-active-layer image bkg-layer)
(the-metal-text-grunge-bkg image bkg-layer grunge-color 100 TRUE TRUE) ;grunge-color
(set! grunge-layer (car (gimp-image-get-active-layer image)))
(set! bkg-layer (car (gimp-image-merge-down image grunge-layer EXPAND-AS-NECESSARY)))
(gimp-drawable-set-name bkg-layer "Grunge")))
(gimp-context-set-pattern pattern)
(gimp-context-set-background bkg-color)
(gimp-context-set-gradient gradient)
(if (= bkg-type 2)
(begin
(gimp-drawable-fill bkg-layer PATTERN-FILL)
(gimp-drawable-set-name bkg-layer (string-append (car (gimp-drawable-get-name bkg-layer)) "_pattern" "_" pattern))))
(if (= bkg-type 3)
(begin
(gimp-drawable-fill bkg-layer BACKGROUND-FILL)
(gimp-drawable-set-name bkg-layer (string-append (car (gimp-drawable-get-name bkg-layer)) "_color"))))
(if (= bkg-type 4)
(begin
(gimp-selection-none image)
(gimp-drawable-fill bkg-layer BACKGROUND-FILL)
(set! gradient-type-blend
(cond
(( equal? gradient-type-in 0 ) GRADIENT-SHAPEBURST-ANGULAR)
(( equal? gradient-type-in 1 ) GRADIENT-SHAPEBURST-SPHERICAL)
(( equal? gradient-type-in 2 ) GRADIENT-SHAPEBURST-DIMPLED)))
(set! gradient-type-name
(cond
(( equal? gradient-type-in 0 ) "GRADIENT-SHAPEBURST-ANGULAR")
(( equal? gradient-type-in 1 ) "GRADIENT-SHAPEBURST-SPHERICAL")
(( equal? gradient-type-in 2 ) "GRADIENT-SHAPEBURST-DIMPLED")))
(gimp-edit-blend bkg-layer CUSTOM-MODE NORMAL-MODE gradient-type-blend 100 0 REPEAT-NONE FALSE FALSE 3 0.2 TRUE 0 0 width height)
(gimp-drawable-set-name bkg-layer (string-append gradient "_" gradient-type-name))))
;;;;create the random gradients
(if (= bkg-type 5)
(begin
(gimp-selection-none image)
(gimp-drawable-fill bkg-layer BACKGROUND-FILL)
(set! random_gradient (list-ref (cadr (gimp-gradients-get-list "")) (round (random (car (gimp-gradients-get-list ""))))))
(set! gradient-type (+ 6 (random 3)))
(gimp-context-set-gradient random_gradient)
(gimp-edit-blend bkg-layer CUSTOM-MODE NORMAL-MODE gradient-type 100 0 REPEAT-NONE FALSE FALSE 3 0.2 TRUE 0 0 width height)
(set! gradient-type-name
(cond
(( equal? gradient-type 6 ) "GRADIENT-SHAPEBURST-ANGULAR")
(( equal? gradient-type 7 ) "GRADIENT-SHAPEBURST-SPHERICAL")
(( equal? gradient-type 8 ) "GRADIENT-SHAPEBURST-DIMPLED")))
(set! name-string (string-append (car (gimp-drawable-get-name bkg-layer)) "- Gradient " random_gradient "- Shape " gradient-type-name))
(gimp-drawable-set-name bkg-layer name-string)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))))
;;;;add the lomo to bkg
(if (and (= lomo TRUE) (> bkg-type 0))
(begin
(if (= bkg-type 6)
(begin
(gimp-context-set-background '(255 255 255))
(gimp-drawable-fill bkg-layer BACKGROUND-FILL)))
(gimp-selection-load img-channel)
(gimp-image-set-active-layer image bkg-layer)
(the-metal-text-lomo image (car (gimp-image-get-active-layer image)) lomo-size opacity FALSE TRUE)
(set! lomo-layer (car (gimp-image-get-active-layer image)))
(if (and (< bkg-type 6) (> bkg-type 0)) (plug-in-colortoalpha 1 image lomo-layer '(255 255 255)))
(if (= bkg-type 6)
(begin
(set! bkg-layer (car (gimp-image-merge-down image lomo-layer EXPAND-AS-NECESSARY)))
(plug-in-colortoalpha 1 image bkg-layer '(255 255 255))))
))
(gimp-image-resize-to-layers image)
(if (= conserve FALSE)
(begin
(set! metal-text-layer (car (gimp-image-merge-visible-layers image 0)))
(gimp-drawable-set-name metal-text-layer text)
(if (= 3d-effect TRUE) (gimp-drawable-set-name metal-text-layer (string-append text "-3D")))
(if (= bkg-type 5)
(begin
(set! name-string (string-append (car (gimp-drawable-get-name metal-text-layer)) "- Gradient " random_gradient "- Shape " gradient-type-name))
(gimp-drawable-set-name metal-text-layer name-string)))))
(gimp-image-remove-channel image img-channel)
(gimp-context-pop)
(gimp-display-new image)
(gimp-displays-flush)
)
)
(script-fu-register "script-fu-metal-text"
"Metal Text"
"Rel6-Create a Metalic Text over a Background layer."
"Graechan"
"Graechan - http://gimpchat.com"
"Oct 2012"
""
SF-TEXT "Text" "Metal\nText"
SF-OPTION "Justify" '("Centered" "Left" "Right")
SF-ADJUSTMENT "Letter Spacing" '(0 -100 100 1 5 0 0)
SF-ADJUSTMENT "Line Spacing" '(0 -500 500 1 10 0 0)
SF-FONT "Font" "JasmineUPC Bold"
SF-ADJUSTMENT "Font size (pixels)" '(350 6 500 1 1 0 1)
SF-OPTION "Metal Finish Type" '("Chrome" "Gold" "Silver" "Copper" "Bronze" "Colored Tint")
SF-OPTION "Metal Finish polish" '("Maximum" "Medium" "Soft")
SF-ADJUSTMENT "Brightness" '(50 0 100 1 10 0 0)
SF-COLOR "Tint Color" '(0 0 255)
SF-TOGGLE "Add a 3D Effect" TRUE
SF-ADJUSTMENT "3D Height (pixels)" '(30 1 100 1 10 0 0)
SF-OPTION "Background Type" '("Starlight" "Grunge" "Pattern" "Color" "Gradient" "Random Gradient" "None")
SF-PATTERN "Pattern" "Pink Marble"
SF-COLOR "Background and Grunge color" '(207 194 162)
SF-GRADIENT "Background Gradient" "Abstract 3"
SF-OPTION "Gradient Shape if Bkg-type=gradient" '("GRADIENT-SHAPEBURST-ANGULAR" "GRADIENT-SHAPEBURST-SPHERICAL" "GRADIENT-SHAPEBURST-DIMPLED")
SF-TOGGLE "Add Lomo to Background" FALSE
SF-ADJUSTMENT "Lomo Size" '(0 0 200 1 10 0 0)
SF-ADJUSTMENT "Lomo Opacity" '(80 0 100 1 10 0 0)
SF-TOGGLE "Keep the Layers" FALSE
)
(script-fu-menu-register "script-fu-metal-text"
"<Image>/Script-Fu/Logos/"
)
(define (the-metal-text-shine image drawable
shadow-size
shadow-opacity
conserve)
(let* (
(image-layer (car (gimp-image-get-active-layer image)))
(width (car (gimp-image-width image)))
(height (car (gimp-image-height image)))
(sel (car (gimp-selection-is-empty image)))
(layer-name (car (gimp-drawable-get-name image-layer)))
(img-layer 0)
(img-channel 0)
(bkg-layer 0)
(shadow-layer 0)
(tmp-layer 0)
)
(gimp-context-push)
(gimp-image-undo-group-start image)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))
(gimp-layer-add-alpha image-layer)
(if (= sel TRUE) (gimp-selection-layer-alpha image-layer))
(set! img-layer (car (gimp-layer-new image width height RGBA-IMAGE "img-layer" 100 NORMAL-MODE)))
(gimp-image-add-layer image img-layer -1)
(gimp-drawable-fill img-layer BACKGROUND-FILL)
(gimp-edit-fill img-layer FOREGROUND-FILL)
;;;;create channel
(gimp-selection-save image)
(set! img-channel (car (gimp-image-get-active-drawable image)))
(gimp-channel-set-opacity img-channel 100)
(gimp-drawable-set-name img-channel "img-channel")
(gimp-image-set-active-layer image img-layer)
(gimp-drawable-set-name image-layer "Original Image")
;;;;create the background layer
(set! bkg-layer (car (gimp-layer-new image width height RGBA-IMAGE "Background" 100 NORMAL-MODE)))
(gimp-image-add-layer image bkg-layer 1)
;;;;apply the image effects
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))
(plug-in-gauss-rle2 RUN-NONINTERACTIVE image img-layer 12 12)
(plug-in-emboss RUN-NONINTERACTIVE image img-layer 225 84 10 TRUE)
(gimp-selection-invert image)
(gimp-edit-clear img-layer)
(gimp-selection-invert image)
(plug-in-colortoalpha RUN-NONINTERACTIVE image img-layer '(254 254 254));;fefefe
(plug-in-gauss-rle2 RUN-NONINTERACTIVE image img-channel 15 15)
(plug-in-blur RUN-NONINTERACTIVE image img-layer)
(gimp-image-set-active-layer image bkg-layer)
(plug-in-displace RUN-NONINTERACTIVE image bkg-layer 8 8 TRUE TRUE img-channel img-channel 1)
(gimp-image-remove-layer image bkg-layer)
;;;;create the shadow
(if (> shadow-size 0)
(begin
(script-fu-drop-shadow image img-layer shadow-size shadow-size shadow-size '(0 0 0) shadow-opacity FALSE)
(set! tmp-layer (car (gimp-layer-new image width height RGBA-IMAGE "temp" 100 NORMAL-MODE)))
(gimp-image-add-layer image tmp-layer -1)
(gimp-image-raise-layer image tmp-layer)
(gimp-image-merge-down image tmp-layer CLIP-TO-IMAGE)
(set! shadow-layer (car (gimp-image-get-active-drawable image)))
(gimp-image-lower-layer image shadow-layer)
)
)
(if (= conserve FALSE)
(begin
(set! img-layer (car (gimp-image-merge-down image img-layer CLIP-TO-IMAGE)))
(set! img-layer (car (gimp-image-merge-down image img-layer CLIP-TO-IMAGE)))
(gimp-drawable-set-name img-layer layer-name)
)
)
(gimp-image-remove-channel image img-channel)
(gimp-selection-none image)
(gimp-image-undo-group-end image)
(gimp-context-pop)
(gimp-displays-flush)
)
)
(define (the-background-light&waves image drawable
beam-height-in
blur
gradient
reverse
cnt-in
conserve
)
(let* (
(offx 0)
(offy 0)
(bkg-layer (car (gimp-image-get-active-layer image)))
(type (car (gimp-drawable-type-with-alpha drawable)))
(width (car (gimp-image-width image)))
(height (car (gimp-image-height image)))
(beam-layer (car (gimp-layer-new image width beam-height-in RGBA-IMAGE "Beam" 100 NORMAL-MODE)))
(beam-width (car (gimp-drawable-width beam-layer)))
(beam-height (car (gimp-drawable-height beam-layer)))
(beam-copy 0)
(beam-copy1 0)
(color-layer 0)
(beam-channel 0)
(selection-bounds 0)
(dust-top 0)
(top-height 0)
(dust-bot 0)
(bot-height 0)
(cnt (/ cnt-in 2))
(x 0)
(y 0)
(*newpoint* (cons-array 2 'double))
)
(gimp-context-push)
(gimp-image-undo-group-start image)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))
(gimp-image-add-layer image beam-layer -1)
;;;;centre the beam layer
(set! offx (/ (- width beam-width) 2))
(set! offy (/ (- height beam-height) 2))
(gimp-layer-set-offsets beam-layer offx offy)
;;;;set the bkg clolor
(gimp-edit-fill bkg-layer FOREGROUND-FILL)
;;;;set the beam clolor
(gimp-edit-fill beam-layer BACKGROUND-FILL)
(gimp-layer-resize-to-image-size beam-layer)
(set! beam-copy (car (gimp-layer-copy beam-layer TRUE)))
(gimp-image-add-layer image beam-copy 1)
(gimp-drawable-set-name beam-copy "Beam-copy")
(set! beam-copy1 (car (gimp-layer-copy beam-layer TRUE)))
(gimp-image-add-layer image beam-copy1 1)
(gimp-drawable-set-name beam-copy1 "Beam-copy#1")
(plug-in-gauss-rle2 RUN-NONINTERACTIVE image beam-copy (* blur 5) (* blur 5))
(plug-in-gauss-rle2 RUN-NONINTERACTIVE image beam-copy1 (* blur 15) (* blur 15))
(plug-in-gauss-rle2 RUN-NONINTERACTIVE image beam-layer blur blur)
(gimp-selection-layer-alpha beam-layer)
;;;;save the selection
(gimp-selection-save image)
(set! beam-channel (car (gimp-image-get-active-drawable image)));set variable (beam-channel 0)
(gimp-channel-set-opacity beam-channel 100)
(gimp-drawable-set-name beam-channel "Beam-channel")
(set! selection-bounds (cdr (gimp-selection-bounds image)))
(gimp-selection-none image)
;;;;create the beam color
(set! color-layer (car (gimp-layer-new image width height RGBA-IMAGE "Color" 100 MULTIPLY-MODE)))
(gimp-image-set-active-layer image beam-layer)
(gimp-image-add-layer image color-layer -1)
(gimp-context-set-gradient gradient)
(gimp-edit-blend color-layer CUSTOM-MODE NORMAL-MODE GRADIENT-LINEAR 100 0 REPEAT-NONE reverse FALSE 3 0.2 TRUE 0 (/ height 2) (* width 2) (/ height 2))
;;;;create the Dust-layers
(set! dust-top (car (gimp-layer-new image width (cadr selection-bounds) RGBA-IMAGE "Dust-Top" 100 NORMAL-MODE)))
(gimp-image-add-layer image dust-top -1)
(set! top-height (car (gimp-drawable-height dust-top)))
(set! dust-bot (car (gimp-layer-new image width (- height (cadddr selection-bounds)) RGBA-IMAGE "Dust-Bot" 100 NORMAL-MODE)))
(gimp-image-add-layer image dust-bot 1)
(set! bot-height (car (gimp-drawable-height dust-bot)))
(gimp-layer-set-offsets dust-bot 0 (cadddr selection-bounds))
(gimp-context-set-brush "Sparks")
(gimp-context-set-brush-default-size)
(while (> cnt 0)
(set! x (round (random width)))
(set! y (round (random top-height)))
(aset *newpoint* 0 x) ; set the paint array
(aset *newpoint* 1 y)
(gimp-paintbrush-default dust-top 2 *newpoint*)
(set! x (round (random width)))
(set! y (round (random bot-height)))
(aset *newpoint* 0 x) ; set the paint array
(aset *newpoint* 1 y)
(gimp-paintbrush-default dust-bot 2 *newpoint*)
(set! cnt (- cnt 1))
)
(gimp-layer-resize-to-image-size dust-top)
(gimp-layer-resize-to-image-size dust-bot)
(if (= conserve FALSE) (gimp-image-remove-channel image beam-channel))
(gimp-displays-flush)
(gimp-image-undo-group-end image)
(gimp-context-pop)
)
)
(define (the-metal-text-grunge-bkg image drawable
grunge-color
opacity
keep-selection-in
conserve)
(let* (
(image-layer (car (gimp-image-get-active-layer image)))
(width (car (gimp-image-width image)))
(height (car (gimp-image-height image)))
(alpha (car (gimp-drawable-has-alpha image-layer)))
(sel (car (gimp-selection-is-empty image)))
(layer-name (car (gimp-drawable-get-name image-layer)))
(keep-selection keep-selection-in)
(selection-channel 0)
(paper-layer 0)
(mottle-layer 0)
(bump-layer 0)
(nominal-burn-size 30)
(burn-size 0)
)
(set! burn-size (/ (* nominal-burn-size (max width height 1))))
(gimp-context-push)
(gimp-image-undo-group-start image)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))
(if (= alpha FALSE) (gimp-layer-add-alpha image-layer))
;;;;check that a selection was made if not make one
(if (= sel TRUE) (set! keep-selection FALSE))
(if (= sel TRUE) (gimp-selection-all image))
;;;;create selection-channel
(gimp-selection-save image)
(set! selection-channel (car (gimp-image-get-active-drawable image)))
(gimp-channel-set-opacity selection-channel 100)
(gimp-drawable-set-name selection-channel "selection-channel")
(gimp-image-set-active-layer image image-layer)
(gimp-selection-none image)
(set! paper-layer (car (gimp-layer-new image width height RGBA-IMAGE "Paper Layer" 100 NORMAL-MODE)))
(gimp-image-add-layer image paper-layer 1)
(gimp-context-set-background grunge-color)
(gimp-edit-fill paper-layer BACKGROUND-FILL)
(plug-in-apply-canvas RUN-NONINTERACTIVE image paper-layer 0 1)
(set! mottle-layer (car (gimp-layer-new image width height RGBA-IMAGE "Mottle Layer" opacity 21)))
(gimp-image-add-layer image mottle-layer 1)
(plug-in-solid-noise RUN-NONINTERACTIVE image mottle-layer 0 0 (rand 65536) 1 2 2)
(set! paper-layer (car (gimp-image-merge-down image mottle-layer CLIP-TO-IMAGE)))
(plug-in-spread 1 image paper-layer 5 5)
(set! bump-layer (car (gimp-layer-new image width height RGBA-IMAGE "bump-layer" 100 GRAIN-EXTRACT-MODE)))
(gimp-image-add-layer image bump-layer 1)
(gimp-context-set-pattern "Slate")
(gimp-drawable-fill bump-layer PATTERN-FILL)
(plug-in-bump-map 1 image paper-layer bump-layer 135 45 3 0 0 0 0 TRUE FALSE 0)
(gimp-image-remove-layer image bump-layer)
(gimp-selection-load selection-channel)
(gimp-selection-shrink image 10)
(script-fu-distress-selection image
paper-layer
127 ;Threshold (bigger 1<-->255 smaller)
8 ;Spread (8 0 1000 1 10 0 1)
4 ;Granularity (1 is low) (4 1 25 1 10 0 1)