-
Notifications
You must be signed in to change notification settings - Fork 0
/
polished_plastic_fun_299n.scm
1229 lines (1114 loc) · 41.7 KB
/
polished_plastic_fun_299n.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
;
; File > Create > Logos > Polished Plastic Fu
; Filters > Alpha to Logo > Polished Plastic Fu
;
; origine : http://www.lefinnois.net/wp/index.php/2007/10/29/mise-a-jour-des-script-fu-pour-the-gimp-24/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; plasticlogo.scm
; Version 0.8 (For The Gimp 2.0 and 2.2)
; A Script-Fu that create a Polished Plastic Text or Shape
;
; Copyright (C) 2004-2007 Denis Bodor <lefinnois@lefinnois.net>
;
; 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 2
; 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.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;
;299d update for gimp 2.99.3 by viforlinux.wordpress.com
;299k added text alignment functions transparence, and materials carbon fiber, aluminium, jeans, bovination, camouflage
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define list-blend-dir '("Top-Botton" "Bottom-Top" "Left-Right" "Right-Left" "Diag-Top-Left" "Diag-Top-Right" "Diag-Bottom-Left" "Diag-Bottom-Right" "Diag-to-center" "Diag-from-center" "Center-to-Top center" "Center-to-Bottom center" ))
(define list-fill-dir '("Color" "Pattern" "Gradient" "Carbon fiber" "Aluminium Brushed" "Aluminium Brushed Light" "Blue Jeans" "Dark Jeans" "Bovination 2.10 only" "Camouflage 2.10 only" "Bovination 2.99" "Camouflage 2.99" "Plasma" "None" "Patchwork" "Diffraction" "Pizza" "Leopard" "Giraffe" "Zebra" "Leopard 2 colors" "Snake" "Snake 2 colors"))
; Fix code for gimp 2.99.6 working in 2.10
(cond ((not (defined? 'gimp-drawable-get-width)) (define gimp-drawable-get-width gimp-drawable-width)))
(cond ((not (defined? 'gimp-drawable-get-height)) (define gimp-drawable-get-height gimp-drawable-height)))
(cond ((not (defined? 'gimp-drawable-get-offsets)) (define gimp-drawable-get-offsets gimp-drawable-offsets)))
(define (fun-util-image-resize-from-layer image layer)
(let* (
(width (car (gimp-drawable-get-width layer)))
(height (car (gimp-drawable-get-height layer)))
(posx (- (car (gimp-drawable-get-offsets layer))))
(posy (- (car (gimp-drawable-get-offsets layer))))
)
(gimp-image-resize image width height posx posy)
)
)
(define (material-carbon fond) (begin
(gimp-context-set-pattern "Parque #3")
(gimp-drawable-fill fond FILL-PATTERN)
(gimp-drawable-desaturate fond 1)
(gimp-drawable-brightness-contrast fond -0.5 0.15)
))
(define (material-color fond-color fond) (begin
(gimp-context-set-paint-mode 28)
(gimp-context-set-foreground fond-color)
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
;(gimp-edit-bucket-fill fond 0 0 100 0 FALSE 100 100)
))
(define (material-pattern pattern fond) (begin
(gimp-context-set-pattern pattern)
(gimp-drawable-fill fond FILL-PATTERN)
))
(define (material-bovination fond image) (begin
(plug-in-solid-noise 0 image fond 0 0 (random 65535) 1 16 4)
;(gimp-brightness-contrast fond 0 127) ; cambiare!
; (gimp-drawable-brightness-contrast fond 0.4 0.5)
(gimp-drawable-levels fond 0 0.1 0.4 FALSE 0.1 0.1 0.2 FALSE)
(gimp-drawable-brightness-contrast fond 0 0.5)
(gimp-drawable-brightness-contrast fond 0 0.5)
))
(define (material-bovination-2 fond image) (begin
(plug-in-solid-noise 0 image fond 0 0 (random 65535) 1 16 4)
(gimp-drawable-equalize fond 0)
; (gimp-drawable-threshold fond HISTOGRAM-VALUE 0 1)
;(gimp-brightness-contrast fond 0 127) ; cambiare!
(gimp-drawable-brightness-contrast fond 0 0.5)
;(gimp-drawable-levels fond 0 0.1 0.4 FALSE 0.1 0.1 0.2 FALSE)
(gimp-drawable-brightness-contrast fond 0 0.5)
(gimp-drawable-brightness-contrast fond 0 0.5)
;(gimp-drawable-levels fond 0 0 0.4 FALSE 0.1 0.1 0.2 FALSE)
(gimp-drawable-brightness-contrast fond 0 0.5)
))
(define (material-camo2 fond image) (begin
(gimp-selection-none image)
(define color1 '(136 125 52))
(define color2 '(62 82 22))
(define color3 '(50 28 0))
;(gimp-context-set-paint-mode LAYER-MODE-NORMAL-LEGACY)
(gimp-context-set-paint-mode LAYER-MODE-NORMAL)
(material-bovination-2 fond image)
(gimp-image-select-color image 0 fond '(255 255 255) )
(gimp-selection-grow image 2)
(gimp-context-set-foreground color1 )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-invert image)
(gimp-context-set-foreground color2 )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
(gimp-image-select-color image 0 fond color1)
(gimp-selection-grow image 2)
(material-bovination-2 fond image)
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(0 0 0) )
(gimp-selection-grow image 2)
(gimp-context-set-foreground color1 )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(255 255 255))
(gimp-selection-grow image 2)
(gimp-context-set-foreground color3 )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
))
(define (material-camo1 fond image) (begin
(gimp-selection-none image)
(plug-in-solid-noise 0 image fond 0 0 (random 65535) 1 16 4)
;(gimp-brightness-contrast fond 0 127) ; cambiare!
; (gimp-drawable-brightness-contrast fond 0.4 0.5)
(gimp-drawable-levels fond 0 0.1 0.4 FALSE 0.1 0.1 0.2 FALSE)
(gimp-drawable-brightness-contrast fond 0 0.5)
(gimp-drawable-brightness-contrast fond 0 0.5)
(gimp-drawable-brightness-contrast fond 0 0.5)
(gimp-image-select-color image 0 fond '(255 255 255) )
(gimp-selection-grow image 2)
(gimp-context-set-foreground '(33 100 58) )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-invert image)
(gimp-context-set-foreground '(170 170 60) )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(33 100 58))
(gimp-selection-grow image 2)
(plug-in-solid-noise 0 image fond 0 0 (random 65535) 1 16 4)
(gimp-drawable-levels fond 0 0.1 0.4 FALSE 0.1 0.1 0.2 FALSE)
(gimp-drawable-brightness-contrast fond 0 0.5)
(gimp-drawable-brightness-contrast fond 0 0.5)
(gimp-drawable-brightness-contrast fond 0 0.5)
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(255 255 255) )
(gimp-selection-grow image 2)
(gimp-context-set-foreground '(33 100 58) )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(0 0 0 ) )
(gimp-selection-grow image 2)
(gimp-context-set-foreground '(150 115 100) )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
))
(define (material-alubrushed fond image) (begin
(gimp-context-set-pattern "Blue Squares")
(gimp-drawable-fill fond FILL-PATTERN)
(gimp-drawable-desaturate fond 1)
(gimp-drawable-brightness-contrast fond -0.5 0.15)
(gimp-selection-none image)
(plug-in-gauss-iir TRUE image fond 20 TRUE TRUE)
(plug-in-randomize-hurl 0 image fond 50 50 TRUE 0)
(plug-in-mblur 0 image fond 0 25 0 0 0)
(gimp-drawable-colorize-hsl fond 0 0 10 )
;(script-fu-colorize 0 image fond 959595 1)
))
(define (material-alubrushed-light fond image) (begin
;(gimp-context-set-gradient "Flare Rays Size 1")
(gimp-context-set-gradient "Rounded edge")
(gimp-context-set-gradient-repeat-mode 0)
(gimp-drawable-edit-gradient-fill
fond
;BLEND-FG-TRANSPARENT
;LAYER-MODE-NORMAL-LEGACY
0 ;GRADIENT-LINEAR
0 ; 100
0
;REPEAT-NONE
;FALSE
;FALSE
100
0
0 ;FALSE
0
0
(car (gimp-drawable-get-width fond))
0
)
(gimp-drawable-desaturate fond 1)
(gimp-drawable-brightness-contrast fond -0.5 0.15)
(gimp-selection-none image)
(plug-in-gauss-iir TRUE image fond 20 TRUE TRUE)
(plug-in-randomize-hurl 0 image fond 5 5 TRUE 0)
(plug-in-mblur 0 image fond 0 25 0 0 0)
(gimp-drawable-colorize-hsl fond 0 0 10 )
))
(define (material-blue-jeans fond image col-opt) (begin
(gimp-context-set-gradient "Rounded edge")
(gimp-context-set-gradient-repeat-mode 1)
(gimp-drawable-edit-gradient-fill
fond
;BLEND-FG-TRANSPARENT
;LAYER-MODE-NORMAL-LEGACY
0 ;GRADIENT-LINEAR
0 ; 100
0
;REPEAT-NONE
;FALSE
;FALSE
100
0
0 ;FALSE
0
0
5
5
)
(gimp-drawable-brightness-contrast fond -0.5 0.15)
(plug-in-randomize-hurl 0 image fond 5 5 TRUE 0)
(gimp-drawable-desaturate fond 1)
(plug-in-gauss-iir TRUE image fond 3 TRUE TRUE)
;(gimp-drawable-colorize-hsl fond 230 36 20 )
(if (= col-opt 0)
(gimp-drawable-colorize-hsl fond 230 36 20 )
;(gimp-drawable-brightness-contrast fond 0.0 -0.5)
)
(if (= col-opt 1)
;(gimp-drawable-colorize-hsl fond 0 0 0)
(gimp-drawable-brightness-contrast fond -0.2 0.4)
)
))
(define (material-plasma fond image) (begin
;(gimp-layer-set-lock-alpha fond TRUE)
(plug-in-plasma 1 image fond (rand 999999999) 7) ; Add plasma
))
(define (material-none) )
(define (material-patchwork fond image) (begin
(plug-in-plasma 1 image fond (rand 999999999) (+ 1 (random 3))) ; Rnd Plasma Fill
(plug-in-cubism 1 image fond 6 10 0)
))
(define (material-diffraction fond image) (begin
(set! *seed* (car (gettimeofday))) ; Random Number Seed From Clock (*seed* is global)
(random-next) ; Next Random Number Using Seed
(plug-in-diffraction 1 image fond .815 1.221 1.123 (+ .821 (rand 2)) (+ .821 (rand 2)) (+ .974 (rand 2)) .610 .677 .636 .066 (+ 27.126 (rand 20)) (+ -0.437 (rand 1)))
))
(define (material-pizza fond image) (begin
;(gimp-layer-set-lock-alpha fond TRUE)
(material-bovination-2 fond image)
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(0 0 0) )
(gimp-selection-grow image 3)
(gimp-context-set-foreground '(255 0 0) )
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
(gimp-layer-set-lock-alpha fond TRUE)
(plug-in-oilify 1 image fond 20 0)
))
(define (material-leopard-old fond image) (begin
(gimp-selection-none image) (material-bovination fond image)
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(255 255 255) )
(gimp-selection-shrink image 8)
(material-bovination fond image)
(gimp-image-select-color image 0 fond '(255 255 255) )
(gimp-selection-shrink image 8)
(material-bovination fond image)
(gimp-image-select-color image 0 fond '(255 255 255) )
(gimp-selection-shrink image 8)
(material-bovination fond image)
(gimp-image-select-color image 0 fond '(255 255 255) )
(gimp-selection-shrink image 8)
(material-bovination fond image)
(gimp-image-select-color image 0 fond '(0 0 0) )
(gimp-selection-shrink image 8)
;(script-fu-distress-selection 1 image fond 127 8 4 2 1 1)
;(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
))
(define (material-leopard fond image) (begin
;(gimp-layer-set-lock-alpha fond TRUE)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(208 169 110))
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
;(plug-in-mosaic 1 image fond 30 1 7 0.5 0 135 0 1 0 1 0 1 )
(plug-in-mosaic 1 image fond 30 1 7 0.5 0 135 0 1 0 1 1 1 )
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(0 0 0) )
(gimp-selection-shrink image 1)
;(script-fu-distress-selection 1 image fond 50 4 2 2 1 1)
; (gimp-selection-shrink image 1)
(gimp-context-set-foreground '(189 140 84))
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
;(plug-in-wind 1 image fond 1 3 1 0 0)
;(plug-in-oilify-enhanced 1 image fond 1 12 fond 12 fond)
(plug-in-oilify 1 image fond 5 0)
(plug-in-oilify 1 image fond 6 0)
))
(define (material-snake fond image) (begin
;(gimp-layer-set-lock-alpha fond TRUE)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(208 169 110))
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(plug-in-mosaic 1 image fond 30 1 7 0.5 0 135 0 1 0 1 0 1 )
;(plug-in-mosaic 1 image fond 30 1 7 0.5 0 135 0 1 0 1 1 1 )
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(0 0 0) )
(gimp-selection-shrink image 1)
;(script-fu-distress-selection 1 image fond 50 4 2 2 1 1)
; (gimp-selection-shrink image 1)
(gimp-context-set-foreground '(189 140 84))
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
;(plug-in-wind 1 image fond 1 3 1 0 0)
;(plug-in-oilify-enhanced 1 image fond 1 12 fond 12 fond)
(gimp-context-set-foreground '(255 255 255))
(gimp-context-set-background '(0 0 0))
(plug-in-mosaic 1 image fond 7 1 1 0.5 0 135 0 1 0 1 0 1 )
(plug-in-oilify 1 image fond 2 0)
;(plug-in-oilify 1 image fond 6 0)
))
(define (material-snake2 fond image color color2) (begin
;(gimp-layer-set-lock-alpha fond TRUE)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background color)
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(plug-in-mosaic 1 image fond 30 1 7 0.5 0 135 0 1 0 1 0 1 )
;(plug-in-mosaic 1 image fond 30 1 7 0.5 0 135 0 1 0 1 1 1 )
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(0 0 0) )
(gimp-selection-shrink image 1)
;(script-fu-distress-selection 1 image fond 50 4 2 2 1 1)
; (gimp-selection-shrink image 1)
(gimp-context-set-foreground color2)
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
;(plug-in-wind 1 image fond 1 3 1 0 0)
;(plug-in-oilify-enhanced 1 image fond 1 12 fond 12 fond)
(gimp-context-set-foreground '(255 255 255))
(gimp-context-set-background '(0 0 0))
(plug-in-mosaic 1 image fond 7 1 1 0.5 0 135 0 1 0 1 0 1 )
(plug-in-oilify 1 image fond 2 0)
;(plug-in-oilify 1 image fond 6 0)
))
(define (material-leopard2 fond image color color2 colopt) (begin
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background color)
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(plug-in-mosaic 1 image fond 30 1 7 0.5 0 135 0 1 0 1 1 1 )
(gimp-selection-none image)
(gimp-image-select-color image 0 fond '(0 0 0) )
(gimp-selection-shrink image 1)
(gimp-context-set-foreground color2)
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-selection-none image)
(plug-in-oilify 1 image fond 5 0)
(plug-in-oilify 1 image fond 6 0)
))
(define (material-giraffe fond image) (begin
;(gimp-layer-set-lock-alpha fond TRUE)
(gimp-context-set-foreground '(112 68 31))
(gimp-context-set-background '(248 202 164))
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(plug-in-mosaic 1 image fond 25 1 5 0.5 0 0 0 1 0 1 1 1 )
(plug-in-wind 1 image fond 1 3 1 0 0)
(plug-in-oilify 1 image fond 2 0)
))
(define (material-zebra fond image) (begin
;(gimp-layer-set-lock-alpha fond TRUE)
(gimp-context-set-paint-mode 0)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))
(gimp-context-set-gradient-fg-bg-rgb)
(gimp-context-set-gradient-repeat-mode 1)
(gimp-drawable-edit-gradient-fill
fond
;BLEND-FG-TRANSPARENT
;LAYER-MODE-NORMAL-LEGACY
0 ;GRADIENT-LINEAR
0 ; 100
0
;REPEAT-NONE
;FALSE
;FALSE
100
0
0 ;FALSE
47
43
69
52
)
(gimp-drawable-brightness-contrast fond 0 0.5)
(plug-in-wind 1 image fond 1 3 1 0 0)
(plug-in-oilify 1 image fond 2 0)
(plug-in-ripple 1 image fond 100 25 1 0 1 TRUE TRUE)
))
;MATERIAL END
(define
(
apply-plastic-logo-effect
img
basetext
border-color
border-size
shadow-color
type
blurred-fill
color
color2
pattern
gradient
gradient-type
direction
;ripple
backtype
fond-color
fond-color2
back-pattern
back-gradient
back-gradient-type
blendir
)
(let*
(
(width (car (gimp-drawable-get-width basetext)))
(height (car (gimp-drawable-get-height basetext)))
(fond (car (gimp-layer-new img width height RGBA-IMAGE "Background" 100 LAYER-MODE-NORMAL-LEGACY)))
(olight (car (gimp-layer-new img width height RGBA-IMAGE "Light Outline" 90 LAYER-MODE-SCREEN-LEGACY)))
(border (car (gimp-layer-new img width height RGBA-IMAGE "Border" 100 LAYER-MODE-NORMAL-LEGACY)))
(refl (car (gimp-layer-new img width height RGBA-IMAGE "Refl" 70 LAYER-MODE-NORMAL-LEGACY)))
(mapeux (car (gimp-layer-new img width height RGBA-IMAGE "Mapper" 100 LAYER-MODE-NORMAL-LEGACY)))
(shad (car (gimp-layer-new img width height RGBA-IMAGE "Shadow" 100 LAYER-MODE-NORMAL-LEGACY)))
(chantext)
(basetextmask)
(xdest)
(ydest)
(reflmask)
(bump-layer -1) ; Bump Map layer
(effect-layer -1) ; Effect layer
)
(gimp-context-push)
;;;;;; filling back with background
(gimp-context-set-background fond-color)
(gimp-context-set-foreground fond-color2)
(gimp-selection-none img)
(fun-util-image-resize-from-layer img basetext)
(gimp-image-insert-layer img fond 0 1)
(gimp-drawable-edit-clear fond)
(if (= backtype 0)
(material-color fond-color fond)
;(begin
; (gimp-context-set-foreground fond-color)
; (gimp-drawable-edit-fill fond FILL-FOREGROUND)
;)
)
(if (= backtype 1)
(material-pattern back-pattern fond)
)
(if (= backtype 2) ;START gradient
(begin
(gimp-selection-none img)
(gimp-drawable-fill fond FILL-BACKGROUND)
(gimp-context-set-gradient back-gradient)
(cond ((= blendir 0) ; Top-Bottom
(define x1 0) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 height) ; Y Blend Ending Point
)
((= blendir 1) ; Bottom-Top
(define x1 0) ; X Blend Starting Point
(define y1 height) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= blendir 2) ; Left-Right
(define x1 0) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 width) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= blendir 3) ; Right-Left
(define x1 width) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= blendir 4) ; Diag-Top-Left
(define x1 0) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 width) ; X Blend Ending Point
(define y2 height) ; Y Blend Ending Point
)
((= blendir 5) ; Diag-Top-Right
(define x1 width) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 height) ; Y Blend Ending Point
)
((= blendir 6) ; Diag-Bottom-Left
(define x1 0) ; X Blend Starting Point
(define y1 height) ; Y Blend Starting Point
(define x2 width) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= blendir 7) ; Diag-Bottom-Right
(define x1 width) ; X Blend Starting Point
(define y1 height) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= blendir 8) ; Diag-to-center
(define x1 0) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 (/ width 2)) ; X Blend Ending Point
(define y2 (/ height 2)) ; Y Blend Ending Point
)
((= blendir 9) ; Diag-from-center
(define x1 (/ width 2)) ; X Blend Starting Point
(define y1 (/ height 2)) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= blendir 10) ; center-to-top-center
(define x1 (/ width 2)) ; X Blend Starting Point
(define y1 (/ height 2)) ; Y Blend Starting Point
(define x2 (/ width 2)) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= blendir 11) ; center-to-bottom-center
(define x1 (/ width 2)) ; X Blend Starting Point
(define y1 (/ height 2)) ; Y Blend Starting Point
(define x2 (/ width 2)) ; X Blend Ending Point
(define y2 height) ; Y Blend Ending Point
)
; (else
; ; For later use..
; )
) ;end cond
;old(gimp-edit-blend fond BLEND-CUSTOM LAYER-MODE-NORMAL-LEGACY back-gradient-type 100 0 REPEAT-NONE back-reverse FALSE 3 0.2 TRUE x1 y1 x2 y2))
(gimp-context-set-background fond-color)
(gimp-context-set-foreground fond-color2)
(gimp-drawable-edit-gradient-fill
fond
;BLEND-CUSTOM
;LAYER-MODE-NORMAL-LEGACY
back-gradient-type
;100
0
REPEAT-NONE
;back-reverse
FALSE
;3
0.2 TRUE x1 y1 x2 y2)
)
);END gradient
(if (= backtype 3)
(material-carbon fond)
)
(if (= backtype 4)
(material-alubrushed fond img)
)
(if (= backtype 5)
(material-alubrushed-light fond img)
)
(if (= backtype 6)
(material-blue-jeans fond img 0)
)
(if (= backtype 7)
(material-blue-jeans fond img 1)
)
(if (= backtype 8)
(material-bovination fond img)
)
(if (= backtype 9)
(material-camo1 fond img)
)
(if (= backtype 10)
(material-bovination-2 fond img)
)
(if (= backtype 11)
(material-camo2 fond img)
)
(if (= backtype 12)
(material-plasma fond img)
)
(if (= backtype 13)
(material-none)
)
(if (= backtype 14)
(material-patchwork fond img)
)
(if (= backtype 15)
(material-diffraction fond img)
)
(if (= backtype 16)
(material-pizza fond img)
)
(if (= backtype 17)
(material-leopard fond img)
)
(if (= backtype 18)
(material-giraffe fond img)
)
(if (= backtype 19)
(material-zebra fond img)
)
(if (= backtype 20)
(material-leopard2 fond img fond-color fond-color2 0)
)
(if (= backtype 21)
(material-snake fond img))
(if (= backtype 22)
(material-snake2 fond img fond-color fond-color2))
; composite text and channel
(gimp-image-select-item img 0 basetext)
(define chantext (car (gimp-selection-save img)))
(define basetextmask (car (gimp-layer-create-mask basetext ADD-MASK-SELECTION)))
(gimp-layer-add-mask basetext basetextmask)
(define reflmask (car (gimp-layer-create-mask refl ADD-MASK-SELECTION)))
(gimp-layer-add-mask refl reflmask)
(gimp-selection-all img)
; choose gradient destination
(cond ((= direction 0) ; Top-Bottom
(define x1 0) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 height) ; Y Blend Ending Point
)
((= direction 1) ; Bottom-Top
(define x1 0) ; X Blend Starting Point
(define y1 height) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= direction 2) ; Left-Right
(define x1 0) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 width) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= direction 3) ; Right-Left
(define x1 width) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= direction 4) ; Diag-Top-Left
(define x1 0) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 width) ; X Blend Ending Point
(define y2 height) ; Y Blend Ending Point
)
((= direction 5) ; Diag-Top-Right
(define x1 width) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 height) ; Y Blend Ending Point
)
((= direction 6) ; Diag-Bottom-Left
(define x1 0) ; X Blend Starting Point
(define y1 height) ; Y Blend Starting Point
(define x2 width) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= direction 7) ; Diag-Bottom-Right
(define x1 width) ; X Blend Starting Point
(define y1 height) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= direction 8) ; Diag-to-center
(define x1 0) ; X Blend Starting Point
(define y1 0) ; Y Blend Starting Point
(define x2 (/ width 2)) ; X Blend Ending Point
(define y2 (/ height 2)) ; Y Blend Ending Point
)
((= direction 9) ; Diag-from-center
(define x1 (/ width 2)) ; X Blend Starting Point
(define y1 (/ height 2)) ; Y Blend Starting Point
(define x2 0) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= direction 10) ; center-to-top-center
(define x1 (/ width 2)) ; X Blend Starting Point
(define y1 (/ height 2)) ; Y Blend Starting Point
(define x2 (/ width 2)) ; X Blend Ending Point
(define y2 0) ; Y Blend Ending Point
)
((= direction 11) ; center-to-bottom-center
(define x1 (/ width 2)) ; X Blend Starting Point
(define y1 (/ height 2)) ; Y Blend Starting Point
(define x2 (/ width 2)) ; X Blend Ending Point
(define y2 height) ; Y Blend Ending Point
)
; (else
; ; For later use..
; )
) ;end cond
(if (= type 0)
(material-color color basetext)
)
(if (= type 1)
(material-pattern pattern basetext)
)
(if (= type 2) ;QUESTO
(begin
(gimp-context-set-gradient gradient)
(gimp-context-set-background color)
(gimp-context-set-foreground color2)
(gimp-drawable-edit-gradient-fill
basetext ;
gradient-type ;0 ;GRADIENT-LINEAR ; gradient type
0 ; opacity
0 ; offset
100 ;
0 ;
0 ; FALSE ; dithering
x1 ; x1
y1 ; y1
x2 ; x2
y2 ; y2
)
)
)
(if (= type 3)
(material-carbon basetext)
)
(if (= type 4)
(material-alubrushed basetext img)
)
(if (= type 5)
(material-alubrushed-light basetext img)
)
(if (= type 6)
(material-blue-jeans basetext img 0)
)
(if (= type 7)
(material-blue-jeans basetext img 1)
)
(if (= type 8)
(material-bovination basetext img )
)
(if (= type 9)
(material-camo1 basetext img )
)
(if (= type 10)
(material-bovination-2 basetext img )
)
(if (= type 11)
(material-camo2 basetext img )
)
(if (= type 12)
(material-plasma basetext img )
)
(if (= type 13)
(material-none)
)
(if (= type 14)
(material-patchwork basetext img)
)
(if (= type 15)
(material-diffraction basetext img)
)
(if (= type 16)
(material-pizza basetext img)
)
(if (= type 17)
(material-leopard basetext img)
)
(if (= type 18)
(material-giraffe basetext img)
)
(if (= type 19)
(material-zebra basetext img)
)
(if (= type 20)
(material-leopard2 basetext img color color2 0)
)
(if (= type 21)
(material-snake basetext img)
)
(if (= type 22)
(material-snake2 basetext img color color2)
)
; Adding light effect on edge
(gimp-selection-none img)
(gimp-image-insert-layer img olight 0 0)
(gimp-drawable-edit-clear olight)
(gimp-image-select-item img 0 chantext)
(gimp-selection-shrink img 3)
(gimp-selection-invert img)
(gimp-context-set-foreground '(255 255 255))
(gimp-drawable-edit-fill olight FILL-FOREGROUND)
(gimp-selection-none img)
(plug-in-gauss-rle2 1 img olight 18 18)
(gimp-image-select-item img 0 chantext)
;(gimp-selection-invert img)
;(gimp-edit-cut olight)
(define litemask (car (gimp-layer-create-mask olight ADD-MASK-SELECTION)))
(gimp-layer-add-mask olight litemask)
(gimp-selection-invert img)
(define shadmask (car (gimp-layer-create-mask shad ADD-MASK-SELECTION)))
(gimp-layer-add-mask shad shadmask)
(gimp-selection-invert img)
; creating black border
(gimp-image-insert-layer img border 0 -1)
(gimp-drawable-edit-clear border)
(gimp-context-set-foreground border-color)
(gimp-image-select-item img 0 chantext)
(gimp-drawable-edit-fill border FILL-FOREGROUND)
(gimp-selection-grow img (/ border-size 2))
(gimp-selection-shrink img border-size)
(gimp-selection-feather img 1)
(gimp-selection-invert img)
;(gimp-edit-cut border)
(define bordmask (car (gimp-layer-create-mask border ADD-MASK-SELECTION)))
(gimp-layer-add-mask border bordmask)
; adding light reflect
(gimp-image-insert-layer img refl 0 -1)
(gimp-drawable-edit-clear refl)
(gimp-image-select-ellipse img
;(gimp-ellipse-select img
2
(- 0 (/ width 2))
(- 0 height)
(* width 2)
(* height 1.54)
;2
;TRUE
;0
;0
)
(gimp-context-set-foreground '(255 255 255))
(gimp-context-set-gradient-fg-transparent) ;chissà
(gimp-context-set-gradient-reverse TRUE)
(gimp-drawable-edit-gradient-fill
refl
;BLEND-FG-TRANSPARENT
;LAYER-MODE-NORMAL-LEGACY
6 ;GRADIENT-LINEAR
0 ; 100
0
;REPEAT-NONE
;FALSE
;FALSE
100
0
0 ;FALSE
(/ width 2)
(* height 0.54)
(/ width 2)
(* height 0.05)
)
(gimp-image-select-item img 0 chantext)
;(define reflmask (car (gimp-layer-create-mask refl ADD-MASK-SELECTION)))
;(gimp-layer-add-mask refl reflmask)
; creating bumpmap map
(gimp-image-insert-layer img mapeux 0 -1)
(gimp-drawable-edit-clear mapeux)
(gimp-selection-none img)
(gimp-context-set-foreground '(0 0 0))
(gimp-drawable-edit-fill mapeux FILL-FOREGROUND)
(gimp-image-select-item img 0 chantext)
(gimp-selection-shrink img 5)
(gimp-context-set-foreground '(255 255 255))
(gimp-drawable-edit-fill mapeux FILL-FOREGROUND)
(gimp-selection-none img)
(plug-in-gauss-rle2 1 img mapeux 18 18)
; bumpmapping:displacing reflect to follow shape
(plug-in-displace
1
img
refl
1.5
1.5
TRUE
TRUE
mapeux
mapeux
1
)
(gimp-image-remove-layer img mapeux)
; back shadow
(gimp-image-insert-layer img shad 0 4)
(gimp-drawable-edit-clear shad)
(gimp-image-select-item img 0 chantext)
(gimp-selection-translate img 0 12)
(gimp-context-set-foreground shadow-color)
(gimp-drawable-edit-fill shad FILL-FOREGROUND)
(gimp-selection-none img)
(plug-in-gauss-rle2 1 img shad 15 15)
; correcting resizing effect on background
;(gimp-context-set-foreground fond-color)
;(gimp-layer-resize-to-image-size fond)
;(gimp-drawable-edit-fill fond FILL-FOREGROUND)
; final effects
;(if
;(= ripple TRUE)
;(plug-in-ripple 1 img basetext 100 5 1 0 1 TRUE FALSE)
;)
(if (= blurred-fill 1)
(plug-in-gauss-iir TRUE img basetext 6 TRUE TRUE)
)
(if (= blurred-fill 2)
(gimp-layer-set-opacity basetext 64)
(gimp-layer-set-opacity olight 33)
(gimp-layer-set-opacity refl 33)
)
(if (= blurred-fill 3)
(gimp-layer-set-opacity basetext 33)
(gimp-layer-set-opacity olight 15)
(gimp-layer-set-opacity refl 15)
)