-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogo-workshop-plus-29919-D.scm
953 lines (859 loc) · 41.6 KB
/
logo-workshop-plus-29919-D.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
;Modernized with ModernizeMatic7 for Gimp 2.10.22 by vitforlinux.wordpress.com - dont remove
; Logo Workshop Release Candidate Version RC 0.04 (10-2011)
;
; Created by GnuTux
; 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 |
; ------------
; RC 0.01 - Initial Release Candidate
; RC 0.02 - Code clean-up, keep user selection, more descriptive variable names, eliminate tabs from source
; Add gloss layer and glass layer
; RC 0.03 - All elements on separate layers, Stroke to path implemented, allow shadow to be toggled off
; RC 0.04 - Dumped stroke to path, code optimization, dialog tweak, double stroke, double bevel, added
; three new effects (cubism, olify & plasma) to fill layer, proper layer arrangement
;
; Define the apply logo effect procedure
(define list-blend-wksp-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" ))
; 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-image-set-active-layer)) (define (gimp-image-set-active-layer image drawable) (gimp-image-set-selected-layers image (vector drawable)))))
(cond ((not (defined? 'gimp-text-fontname)) (define (gimp-text-fontname fn1 fn2 fn3 fn4 fn5 fn6 fn7 fn8 PIXELS fn9) (gimp-text-font fn1 fn2 fn3 fn4 fn5 fn6 fn7 fn8 fn9))))
(define (apply-gauss img drawable x y)(begin (if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(plug-in-gauss 1 img drawable x y 0)
(plug-in-gauss 1 img drawable (* x 0.32) (* y 0.32) 0) )))
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(define sfrepeat '("None" "Sawtooth" "Triangular" "Truncate"))
(define sfrepeat '("None" "Truncate" "Sawtooth" "Triangular" )) )
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(define sffont "LobsterTwo Bold")
(define sffont "LobsterTwo-Bold"))
;Material start
(define (material-wksp-gradient fond image gradient gradient-type direction repeat reverse fond-color) (begin
(define width (car (gimp-drawable-get-width fond)))
(define height (car (gimp-drawable-get-height fond)))
(gimp-context-set-foreground fond-color)
(gimp-drawable-edit-fill fond FILL-FOREGROUND)
(gimp-context-set-gradient-repeat-mode repeat)
; 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
(gimp-context-set-gradient gradient)
(gimp-context-set-gradient-reverse reverse)
(gimp-drawable-edit-gradient-fill fond gradient-type 0 REPEAT-NONE 1 0.0 FALSE x1 y1 x2 y2)
))
;Material END
(define (script-fu-workshop-shine image drawable)
(let* (
;(image-layer (car (gimp-image-get-active-layer image)))
(image-layer (if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(car (gimp-image-get-active-layer image))
(car (list (vector-ref (car (gimp-image-get-selected-layers image)) 0)))))
(width (car (gimp-image-get-width image)))
(height (car (gimp-image-get-height image)))
(layer-name (car (gimp-item-get-name image-layer)))
(img-layer 0)
(img-channel 0)
(bkg-layer 0)
(tmp-layer 0)
)
(gimp-context-push)
(gimp-image-undo-group-start image)
(gimp-context-set-paint-mode LAYER-MODE-NORMAL-LEGACY )
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))
(gimp-image-select-item image 2 image-layer)
(set! img-layer (car (gimp-layer-new image width height RGBA-IMAGE "img-layer" 100 LAYER-MODE-NORMAL-LEGACY)))
(gimp-image-insert-layer image img-layer 0 -1)
(gimp-drawable-fill img-layer FILL-BACKGROUND)
(gimp-drawable-edit-fill img-layer FILL-FOREGROUND)
;;;;create channel
(gimp-selection-save image)
;(set! img-channel (car (gimp-image-get-active-drawable image)))
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(set! img-channel (car (gimp-image-get-active-drawable image)))
(set! img-channel (vector-ref (car (gimp-image-get-selected-drawables image)) 0)) )
(gimp-channel-set-opacity img-channel 100)
(gimp-item-set-name img-channel "img-channel")
(gimp-image-set-active-layer image img-layer)
;(gimp-item-set-name image-layer "Original Image")
;;;;create the background layer
(set! bkg-layer (car (gimp-layer-new image width height RGBA-IMAGE "Background" 100 LAYER-MODE-NORMAL-LEGACY)))
(gimp-image-insert-layer image bkg-layer 0 1)
;;;;apply the image effects
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background '(255 255 255))
(apply-gauss image img-layer 12 12)
(plug-in-emboss RUN-NONINTERACTIVE image img-layer 225 84 10 TRUE)
(gimp-selection-invert image)
(gimp-drawable-edit-clear img-layer)
(gimp-selection-invert image)
(plug-in-colortoalpha RUN-NONINTERACTIVE image img-layer '(254 254 254));;fefefe
(apply-gauss image img-channel 15 15)
;(plug-in-blur RUN-NONINTERACTIVE image img-layer)
(apply-gauss image img-layer 2 2)
(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
;(gimp-image-remove-channel image img-channel)
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(begin)
(gimp-image-merge-down image img-layer 0))
(gimp-image-undo-group-end image)
(gimp-context-pop)
;(gimp-display-new image)
(gimp-displays-flush)
)
)
(define (apply-logo-workshop-plus-299d19 img
logo-layer
fill-style
logo-color
logo-pattern
logo-gradient
logo-grad-type
logo-grad-dir
logo-grad-rep
logo-grad-rvs
bevel-amt
stroke-type
stroke-color
stroke-pattern
stroke-gradient
stroke-grad-type
stroke-grad-dir
stroke-grad-rep
stroke-grad-rvs
stroke-width
shadow-color
shadowx
shadowy
shadow-opacity
effect-style
effect-pattern
effect-depth
alpha2logo)
(let* (
(stroke-layer -1) ; Stroke layer
(bump-layer -1) ; Bump Map layer
(effect-layer -1) ; Effect layer
(fill-layer -1) ; Fill layer
(feather-amt 3) ; Set global feather
(sindex 0) ; Stroke index counter
)
;
; Logo layer
;
; (script-fu-util-image-resize-from-layer img logo-layer) ; logo layer to image size
; (gimp-item-set-name logo-layer "Logo Layer") ; Name logo Layer
;
; Create Shadow Layer (only if opacity > 0)
;
(if (> shadow-opacity 0)
(begin
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(script-fu-drop-shadow img logo-layer shadowx shadowy 3 shadow-color shadow-opacity 1) ; Create shadow
(script-fu-drop-shadow img (vector logo-layer) shadowx shadowy 3 shadow-color shadow-opacity 1) ); Create shadow
)
) ; endif
;
; Selection Check
;
(if (= (car (gimp-selection-is-empty img)) TRUE) ; Check for a selection
(begin
(gimp-image-select-item img 2 logo-layer) ; Select alpha to logo If there isn't one
)
) ; endif
;
; Create Stroke Layer (only if stroke width > 0)
;
(if (> stroke-width 0)
(begin
(set! stroke-layer (car (gimp-layer-new-from-drawable logo-layer img))) ; New Stoke Layer
(gimp-image-insert-layer img stroke-layer 0 0) ; Add it to image
(gimp-image-set-active-layer img stroke-layer) ; Make stroke logo layer active
(gimp-item-set-name stroke-layer "Stroke")
(gimp-layer-resize-to-image-size stroke-layer) ; Name the stroke layer
(gimp-selection-feather img feather-amt) ; Feather the selection
(if (= effect-style 5) ; Double stroke
(begin
(gimp-selection-shrink img effect-depth)
(gimp-selection-invert img) ; Invert the selction
(gimp-drawable-edit-clear stroke-layer) ; Clear stroke layer
(gimp-selection-invert img) ; Invert the selction
(gimp-layer-resize-to-image-size stroke-layer)
)
); endif
; (if (= alpha2logo 1) ; Aplha stroke method
(begin
(gimp-selection-grow img 2) ; Grow the selection
; (gimp-context-set-foreground stroke-color) ; Set stroke color
;(gimp-drawable-edit-bucket-fill stroke-layer 0 0 0) ; Fill with Stroke color
;(gimp-layer-resize-to-image-size stroke-layer)
(plug-in-autocrop-layer 1 img stroke-layer)
;(gimp-drawable-edit-fill stroke-layer FILL-FOREGROUND)
(cond ((= stroke-type 0)
(gimp-context-set-foreground stroke-color) ; Set logo color
;(gimp-drawable-edit-bucket-fill stroke-layer 0 0 0) ; Fill with color
(gimp-drawable-edit-fill stroke-layer FILL-FOREGROUND)
)
((= stroke-type 1)
(gimp-context-set-pattern stroke-pattern)
;(gimp-drawable-edit-bucket-fill stroke-layer 4 0 0) ; Fill with pattern)
(gimp-drawable-edit-fill stroke-layer FILL-PATTERN)
)
((= stroke-type 2)
; (gimp-context-set-gradient stroke-gradient)
;(gimp-context-set-gradient-reverse stroke-grad-rvs)
; (gimp-drawable-edit-gradient-fill stroke-layer GRADIENT-LINEAR 0 0 1 0 0 0 0 0 (car (gimp-drawable-get-height stroke-layer))) ; Fill with gradient
(plug-in-autocrop-layer 1 img stroke-layer)
(material-wksp-gradient stroke-layer img stroke-gradient stroke-grad-type stroke-grad-dir stroke-grad-rep stroke-grad-rvs stroke-color)
(gimp-layer-resize-to-image-size stroke-layer)
)
(else
;(gimp-edit-blend stroke-layer BLEND-CUSTOM LAYER-MODE-NORMAL-LEGACY GRADIENT-LINEAR 100 0 0 FALSE TRUE 3 0.20 TRUE 0 0 0 (car (gimp-drawable-height stroke-layer))) ; Fill with gradient
(gimp-drawable-edit-gradient-fill stroke-layer GRADIENT-LINEAR 0 0 1 0 0 0 0 0 (car (gimp-drawable-get-height stroke-layer))) ; Fill with gradient
)
)
(gimp-layer-resize-to-image-size stroke-layer)
(gimp-selection-shrink img 2) ; Shrink the selection
(gimp-selection-invert img) ; Invert the selction
(gimp-drawable-edit-clear stroke-layer) ; Clear stroke layer
(gimp-selection-invert img) ; Invert the selction
)
; ); endif
; Text stroke method (always do this)
(gimp-selection-shrink img stroke-width) ; Shrink by stroke width
(gimp-drawable-edit-clear stroke-layer) ; Clear all but stroke
)
) ; endif
;
; Create fill layer to hold fill style
;
(set! fill-layer (car (gimp-layer-new-from-drawable logo-layer img))) ; New Fill Layer
(gimp-image-insert-layer img fill-layer 0 1) ; Add it to image
(gimp-image-set-active-layer img fill-layer) ; Make fill layer active
(gimp-layer-resize-to-image-size fill-layer)
(gimp-selection-invert img) ; Invert the stroke selection
(gimp-drawable-edit-clear fill-layer) ; Clear stroke area
(gimp-selection-invert img) ; Invert the stroke selection
(gimp-item-set-name fill-layer "Fill") ; Name fill layer
;
; Fill case structure (0-logo color fill, 1-current pattern, 2-current gradient)
(gimp-context-set-paint-mode 0)
;
(cond ((= fill-style 0)
(gimp-context-set-foreground logo-color) ; Set logo color
;(gimp-drawable-edit-bucket-fill fill-layer 0 0 0) ; Fill with color
(gimp-drawable-edit-fill fill-layer FILL-FOREGROUND)
)
((= fill-style 1)
(gimp-context-set-pattern logo-pattern)
;(gimp-drawable-edit-bucket-fill fill-layer 4 0 0) ; Fill with pattern)
(gimp-drawable-edit-fill fill-layer FILL-PATTERN)
)
((= fill-style 2)
(plug-in-autocrop-layer 1 img fill-layer)
(material-wksp-gradient fill-layer img logo-gradient logo-grad-type logo-grad-dir logo-grad-rep logo-grad-rvs logo-color)
(gimp-layer-resize-to-image-size fill-layer)
)
(else
;(gimp-edit-blend fill-layer BLEND-CUSTOM LAYER-MODE-NORMAL-LEGACY GRADIENT-LINEAR 100 0 0 FALSE TRUE 3 0.20 TRUE 0 0 0 (car (gimp-drawable-height fill-layer))) ; Fill with gradient
(gimp-drawable-edit-gradient-fill fill-layer GRADIENT-LINEAR 0 0 1 0 0 0 0 0 (car (gimp-drawable-get-height fill-layer))) ; Fill with gradient
)
)
;
; Apply additional effects directly to fill style
;
(cond ((= effect-style 6)
(plug-in-cubism 1 img fill-layer effect-depth 3 0) ; Add cubism effect
)
((= effect-style 7)
(plug-in-oilify 1 img fill-layer effect-depth 0) ; Add olify effect
)
((= effect-style 8)
(gimp-selection-none img)
(gimp-layer-set-lock-alpha fill-layer TRUE)
(plug-in-plasma 1 img fill-layer (random 999999999) effect-depth) ; Add plasma
)
((= effect-style 9) ;Glitter
(plug-in-rgb-noise 1 img fill-layer FALSE FALSE 0.6 0.6 0.6 0)
(plug-in-cubism 1 img fill-layer 1 5 0) ; Add cubism effect
)
((= effect-style 10) ;Shined
(script-fu-workshop-shine img fill-layer)
)
)
(gimp-image-select-item img 2 stroke-layer)
(gimp-drawable-edit-clear logo-layer)
(gimp-image-select-item img 2 logo-layer); a little trick for gt-bevel
;
; bevel (only if bevel-amt depth is > 0)
;
(if (> bevel-amt 0)
(begin
(script-fu-add-bevel img fill-layer bevel-amt 0 0) ; Bevel fill layer
(if (= effect-style 4) ; Effect case test
(begin ; Double bevel
(gimp-selection-shrink img stroke-width) ; Shrink by stroke width
(script-fu-add-bevel img fill-layer bevel-amt 0 0) ; Bevel fill layer again
(gimp-selection-grow img stroke-width) ; Reset by stroke width
)
);endif
)
);endif
;
; Pattern Bump (only if bump depth > 0 and additional effect = 1)
;
(if (and(> effect-depth 0)(= effect-style 1))
(begin
(set! effect-layer (car (gimp-layer-new-from-drawable fill-layer img))) ; New effect Layer
(gimp-image-insert-layer img effect-layer 0 -1) ; Add it to image
(gimp-item-set-name effect-layer "Bumped") ; Name effect layer
(set! bump-layer (car (gimp-layer-new-from-drawable fill-layer img))) ; New patten layer
(gimp-context-set-pattern effect-pattern) ; Make bump pattern active
(gimp-drawable-fill bump-layer FILL-PATTERN) ; Fill with pattern
;
; Call bump map procedure (pattern bump)
;
(plug-in-bump-map
1 ; Interactive (0), non-interactive (1)
img ; Input image
effect-layer ; Input drawable
bump-layer ; Bumpmap drawable
130 ; Azimuth (float)
55 ; Elevation (float)
effect-depth ; Depth
0 ; X offset
0 ; Y offset
0 ; Level that full transparency should represent
0 ; Ambient lighting factor
TRUE ; Compensate for darkening
FALSE ; Invert bumpmap
0) ; Type of map (0=linear, 1=spherical, 2=sinusoidal)
)
) ; endif
;
; Create Gloss Effect Layer
;
;
(if (and(> effect-depth 0)(= effect-style 2))
(begin
(set! bump-layer (car (gimp-layer-new-from-drawable logo-layer img))) ; New effect Layer
(gimp-image-insert-layer img bump-layer 0 -1) ; Add it to image
(gimp-item-set-name bump-layer "Gloss") ; Name effect layer
(gimp-selection-shrink img (- effect-depth 4)) ; Shrink selection
(gimp-context-set-foreground '(255 255 255)) ; Set FG to white
(gimp-drawable-edit-bucket-fill bump-layer 0 0 0) ; Fill with color
(apply-gauss img bump-layer 5 5) ; Blur by 3
(gimp-selection-invert img) ; Invert Selection
(gimp-drawable-edit-clear bump-layer) ; Clear all but gloss
(gimp-layer-set-opacity bump-layer (- effect-depth 1)) ; Set Opacity
)
) ; endif
;
; Create Glass Effect Layer
;
;
(if (and(> effect-depth 0)(= effect-style 3))
(begin
(set! bump-layer (car (gimp-layer-new-from-drawable logo-layer img))) ; New effect Layer
(gimp-image-insert-layer img bump-layer 0 -1) ; Add it to image
(gimp-item-set-name bump-layer "Bump") ; Name effect layer
(gimp-context-set-foreground '(255 255 255)) ; Set FG to white
(gimp-drawable-edit-bucket-fill bump-layer 0 0 0) ; Fill with color
(apply-gauss img bump-layer 5 5) ; Blur by 5
(set! effect-layer (car (gimp-layer-new-from-drawable logo-layer img))) ; New patten layer
(gimp-image-insert-layer img effect-layer 0 -1) ; Add it to image
(gimp-item-set-name effect-layer "Glass") ; Name effect layer
(plug-in-bump-map 1 img effect-layer bump-layer 135 45 (+ effect-depth 0) 0 0 0 0 0 0 0) ; Bump it
(gimp-image-set-active-layer img effect-layer) ; Ensure this layer active
(gimp-selection-shrink img (- effect-depth 1)) ; Shrink selection
(gimp-selection-feather img feather-amt) ; feather it
(gimp-drawable-curves-spline effect-layer 4 4 (get-glass-trans-curve 64)) ; Modify alpha channel curves
(gimp-selection-none img) ; Clear Selection
(gimp-drawable-hue-saturation effect-layer 0 0 0 -100 0) ; Desaturate to clear glass
(gimp-drawable-invert effect-layer FALSE) ; Invert colors
(gimp-image-remove-layer img bump-layer) ; Delete the bump layer
; (plug-in-sample-colorize 1 img effect-layer logo-layer TRUE TRUE TRUE TRUE 0 255 1 0 255)
; (gimp-image-remove-layer img bump-layer) ; Dump The Bump
)
) ; endif
); endlet
) ; return (from apply-logo-workshop-plus-299d19)
;
;
; Define function for glass translucency values
;
(define (get-glass-trans-curve parm)
(let* ((curve-value (cons-array 4 'byte)))
(aset curve-value 0 0)
(aset curve-value 1 0)
(aset curve-value 2 255)
(aset curve-value 3 parm)
curve-value
)
) ; return
;
; Define alpha to selection procedure
;
(define (script-fu-logo-workshop-plus-299d-alpha img
logo-layer
fill-style
logo-color
logo-pattern
logo-gradient
logo-grad-type
logo-grad-dir
logo-grad-rep
logo-grad-rvs
bevel-amt
stroke-type
stroke-color
stroke-pattern
stroke-gradient
stroke-grad-type
stroke-grad-dir
stroke-grad-rep
stroke-grad-rvs
stroke-width
shadow-color
shadowx
shadowy
shadow-opacity
effect-style
effect-pattern
effect-depth)
(let* (
(alpha2logo 1) ; 0 - Text mode , 1 - Alpha mode
)
;
; Save current GIMP context
;
(gimp-context-push) ; Push context onto stack
(gimp-image-undo-group-start img) ; Begin undo group
;
; Call apply logo effect procedure
;
(apply-logo-workshop-plus-299d19 img logo-layer fill-style logo-color logo-pattern logo-gradient logo-grad-type logo-grad-dir logo-grad-rep logo-grad-rvs bevel-amt stroke-type stroke-color stroke-pattern stroke-gradient stroke-grad-type stroke-grad-dir stroke-grad-rep stroke-grad-rvs stroke-width shadow-color shadowx shadowy shadow-opacity effect-style effect-pattern effect-depth alpha2logo)
;
; Drop logo layer to bottom
;
(gimp-image-lower-item-to-bottom img logo-layer) ; layer to botton
(gimp-item-set-visible logo-layer FALSE) ; Toggle layer off
(gimp-image-set-active-layer img logo-layer) ; Make it active
(gimp-image-undo-group-end img) ; End undo group
(gimp-context-pop) ; Pop context off stack
(gimp-displays-flush) ; Flush display
) ;endlet
) ; return
;
; Register logo effect to alpha procedure
;
(script-fu-register "script-fu-logo-workshop-plus-299d-alpha"
_"_Logo Workshop PLUS ALPHA 299 D..."
_"Create selected logo effect with a drop shadow"
"GnuTux - http://gimpchat.com"
"GnuTux - GPLv3"
"10-2011"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-OPTION _"Logo Fill Method" '("Color Fill" "Fill With Pattern" "Fill With Gradient")
SF-COLOR _"Logo Fill Color" '(23 131 181)
SF-PATTERN "Logo Fill Pattern" "Burlwood"
SF-GRADIENT "Logo Fill Gradient" "Yellow Orange"
SF-ENUM "Logo Gradient Mode" '("GradientType" "gradient-linear")
SF-OPTION "Gradient Blend Direction" list-blend-wksp-dir
SF-OPTION "Gradient Repeat" sfrepeat
SF-TOGGLE "Gradient Reverse" FALSE
SF-ADJUSTMENT _"Logo Bevel Depth" '(10 0 50 1 1 0 0)
SF-OPTION _"Stroke Fill Method" '("Color" "Pattern" "Gradient")
SF-COLOR _"Stroke Color" '(9 45 68)
SF-PATTERN "Stroke Pattern" "Wood #2"
SF-GRADIENT "Stroke Gradient" "Golden"
SF-ENUM "Stroke Gradient Mode" '("GradientType" "gradient-linear")
SF-OPTION "Gradient Blend Direction" list-blend-wksp-dir
SF-OPTION "Gradient Repeat" sfrepeat
SF-TOGGLE "Gradient Reverse" FALSE
SF-ADJUSTMENT _"Stroke Width" '(3 0 19 1 1 0 0)
SF-COLOR _"Shadow Color" '(0 0 0)
SF-ADJUSTMENT _"Shadow Offset X" '(-6 -99 99 1 1 0 0)
SF-ADJUSTMENT _"Shadow Offset Y" '(4 -99 99 1 1 0 0)
SF-ADJUSTMENT _"Shadow Opacity" '(25 0 100 1 1 0 0)
SF-OPTION _"Added Effect" '("None" "Bump With Pattern" "Simple Gloss Layer" "Translucent/Glass Layer" "Double Bevel" "Double Stroke" "Cubism on Fill" "Oilify on Fill" "Plasma on fill" "Glitter on fill" "Shined")
SF-PATTERN _"Added Effect Pattern" "Bricks"
SF-ADJUSTMENT _"Added Effect Depth" '(7 0 50 1 1 0 0))
(script-fu-menu-register "script-fu-logo-workshop-plus-299d-alpha"
"<Image>/Filters/Alpha to Logo")
;
; Define logo effect text procedure
;
(define (script-fu-logo-workshop-plus-299d text
size
font
justification
letter-spacing
line-spacing
grow-text
outline
fill-style
logo-color
logo-pattern
logo-gradient
logo-grad-type
logo-grad-dir
logo-grad-rep
logo-grad-rvs
bevel-amt
stroke-type
stroke-color
stroke-pattern
stroke-gradient
stroke-grad-type
stroke-grad-dir
stroke-grad-rep
stroke-grad-rvs
stroke-width
shadow-color
shadowx
shadowy
shadow-opacity
effect-style
effect-pattern
effect-depth
inBufferAmount
back-type
back-color
back-pattern
back-gradient
back-grad-type
back-grad-dir
back-grad-rep
back-grad-rvs
vignette
vignette-color
)
(let* (
(theImageWidth 10)
(theImageHeight 10)
(img)
(img
(car
(gimp-image-new
theImageWidth
theImageHeight
RGB
)
)
)
; (img (car (gimp-image-new 256 256 RGB))) ; Create a new image
(text-layer -1) ; Declare and init text-layer
(logo-layer -1) ; Declare and init logo-layer
(bg-layer
(car
(gimp-layer-new
img
theImageWidth
theImageHeight
RGBA-IMAGE
"Background"
100
LAYER-MODE-NORMAL
)
)
)
(theBuffer 0 ) ;create a new layer for the image
(alpha2logo 0) ; 0 - Text mode , 1 - Alpha mode
(justification (cond ((= justification 0) 2)
((= justification 1) 0)
((= justification 2) 1)
((= justification 3) 3)))
)
(gimp-image-insert-layer img bg-layer 0 0)
(gimp-context-push) ; Push context onto stack
;
; Original Text Layer (keep untouched)
;
(gimp-context-set-foreground logo-color) ; Set FG to logo color
(set! text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))) ; Create text layer
(script-fu-util-image-resize-from-layer img text-layer) ; logo layer to image size
(gimp-text-layer-set-letter-spacing text-layer letter-spacing) ; Set Letter Spacing
(gimp-text-layer-set-justification text-layer justification) ; Text Justification (Rev Value)
(gimp-text-layer-set-line-spacing text-layer line-spacing) ; Set Line Spacing
(gimp-item-set-name text-layer "Text") ; Name text Layer
(set! theImageWidth (car (gimp-drawable-get-width text-layer) ) )
(set! theImageHeight (car (gimp-drawable-get-height text-layer) ) )
(set! theBuffer (* theImageHeight (/ inBufferAmount 100) ) )
(set! theImageHeight (+ theImageHeight theBuffer theBuffer) )
(set! theImageWidth (+ theImageWidth theBuffer theBuffer) )
(gimp-image-resize img theImageWidth theImageHeight 0 0)
(gimp-layer-resize text-layer theImageWidth theImageHeight 0 0)
(gimp-layer-set-offsets text-layer theBuffer theBuffer)
(gimp-layer-resize-to-image-size text-layer)
;;;; shrink grow text
(cond ((> grow-text 0)
(gimp-selection-none img)
(gimp-image-select-item img 2 text-layer)
(gimp-selection-grow img (round grow-text))
(gimp-drawable-edit-fill text-layer FILL-FOREGROUND)
)
((< grow-text 0)
(gimp-selection-none img)
(gimp-image-select-item img 2 text-layer)
(gimp-drawable-edit-clear text-layer)
(gimp-selection-shrink img (- grow-text))
(gimp-drawable-edit-fill text-layer FILL-FOREGROUND)
))
;;; outline
(cond ((> outline 0)
(gimp-selection-none img)
(gimp-image-select-item img 2 text-layer)
; (gimp-image-resize-to-layers img)
(gimp-selection-shrink img (round outline))
(gimp-drawable-edit-clear text-layer)
(gimp-image-select-item img 2 text-layer)
))
;
; Logo layer (color woth stroke color and pass to the logo effects procedure)
;
(gimp-context-set-foreground stroke-color) ; Set FG to stroke color
(set! logo-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))) ; Create logo layer
(script-fu-util-image-resize-from-layer img logo-layer) ; logo layer to image size
(gimp-item-set-name logo-layer "Logo Layer") ; Name logo Layer
(gimp-text-layer-set-letter-spacing logo-layer letter-spacing) ; Set Letter Spacing
(gimp-text-layer-set-line-spacing logo-layer line-spacing) ; Set Line Spacing
(gimp-text-layer-set-justification logo-layer justification) ; Text Jusification (Rev Value)
(set! theImageWidth (car (gimp-drawable-get-width logo-layer) ) )
(set! theImageHeight (car (gimp-drawable-get-height logo-layer) ) )
(set! theBuffer (* theImageHeight (/ inBufferAmount 100) ) )
(set! theImageHeight (+ theImageHeight theBuffer theBuffer) )
(set! theImageWidth (+ theImageWidth theBuffer theBuffer) )
(gimp-image-resize img theImageWidth theImageHeight 0 0)
(gimp-layer-resize logo-layer theImageWidth theImageHeight 0 0)
(gimp-layer-set-offsets logo-layer theBuffer theBuffer)
;;;; shrink grow text
(cond ((> grow-text 0)
(gimp-selection-none img)
; (gimp-image-resize-to-layers img)
(gimp-image-select-item img 2 logo-layer)
(gimp-selection-grow img (round grow-text))
(gimp-drawable-edit-fill logo-layer FILL-FOREGROUND)
)
((< grow-text 0)
(gimp-selection-none img)
;(gimp-image-resize-to-layers img)
(gimp-image-select-item img 2 logo-layer)
(gimp-drawable-edit-clear logo-layer)
(gimp-selection-shrink img (- grow-text))
(gimp-drawable-edit-fill logo-layer FILL-FOREGROUND)
))
;;; outline
(cond ((> outline 0)
(gimp-selection-none img)
(gimp-image-select-item img 2 logo-layer)
;(gimp-image-resize-to-layers img)
(gimp-selection-shrink img (round outline))
(gimp-drawable-edit-clear logo-layer)
(gimp-image-select-item img 2 logo-layer)
))
(gimp-layer-resize-to-image-size bg-layer)
(gimp-image-undo-disable img) ; Disallow undo
;(gimp-image-resize-to-layers img)
;
;
; Call the logo effect procedure
;
(apply-logo-workshop-plus-299d19 img logo-layer fill-style logo-color logo-pattern logo-gradient logo-grad-type logo-grad-dir logo-grad-rep logo-grad-rvs bevel-amt stroke-type stroke-color stroke-pattern stroke-gradient stroke-grad-type stroke-grad-dir stroke-grad-rep stroke-grad-rvs stroke-width shadow-color shadowx shadowy shadow-opacity effect-style effect-pattern effect-depth alpha2logo)
(gimp-selection-all img)
(cond ((= back-type 0)
(gimp-context-set-foreground back-color) ; Set logo color
;(gimp-drawable-edit-bucket-fill bg-layer 0 0 0) ; Fill with color
(gimp-drawable-edit-fill bg-layer FILL-FOREGROUND)
)
((= back-type 1)
(gimp-context-set-pattern back-pattern)
;(gimp-drawable-edit-bucket-fill bg-layer 4 0 0) ; Fill with pattern)
(gimp-drawable-edit-fill bg-layer FILL-PATTERN)
)
((= back-type 2)
(material-wksp-gradient bg-layer img back-gradient back-grad-type back-grad-dir back-grad-rep back-grad-rvs back-color)
)
(else
;(gimp-edit-blend bg-layer BLEND-CUSTOM LAYER-MODE-NORMAL-LEGACY GRADIENT-LINEAR 100 0 0 FALSE TRUE 3 0.20 TRUE 0 0 0 (car (gimp-drawable-height bg-layer))) ; Fill with gradient
(gimp-drawable-edit-gradient-fill bg-layer GRADIENT-LINEAR 0 0 1 0 0 0 0 0 (car (gimp-drawable-get-height bg-layer))) ; Fill with gradient
)
)
(if (= vignette TRUE)
(begin
(gimp-image-select-ellipse
img
CHANNEL-OP-REPLACE
0
0
(car (gimp-image-get-width img))
(car (gimp-image-get-height img))
)
(gimp-selection-invert img)
(gimp-selection-feather img (round (/ (car (gimp-image-get-width img)) 5 )))
(gimp-context-set-opacity 50)
(gimp-context-set-background vignette-color)
(gimp-drawable-edit-fill bg-layer FILL-BACKGROUND)
(gimp-selection-none img)
))
(gimp-image-remove-layer img logo-layer) ; Delete the logo layer (stroke color dup in this case)
(gimp-image-set-active-layer img text-layer) ; Make text layer active
(gimp-selection-none img) ; Clear selection
(gimp-image-undo-enable img) ; Allow undo
(gimp-context-pop) ; Pop context off stack
(gimp-display-new img) ; Show the image
) ; endlet
) ; return
;
; Register the script
;
(script-fu-register "script-fu-logo-workshop-plus-299d"
_"_Logo Workshop PLUS LOGO 299 D..."
_"Create logo with selected fill type, drop shadow and effect"
"GnuTux - http://gimpchat.com"
"GnuTux - GPLv3"
"10-2011"
""
SF-TEXT _"Text" "Logo Workshop\nPlus\n2.99.19"
SF-ADJUSTMENT _"Font size (pixels)" '(220 2 1000 1 10 0 0)
SF-FONT _"Font" sffont
SF-OPTION _"Text Justification" '("Centered" "Left" "Right" "Fill")
SF-ADJUSTMENT _"Letter Spacing" '(0 -50 50 1 5 0 0)
SF-ADJUSTMENT _"Line Spacing" '(-5 -300 300 1 10 0 0)
SF-ADJUSTMENT _"Shrink / Grow Text" '(0 -12 12 1 10 0 0)
SF-ADJUSTMENT _"Outline" '(0 0 20 1 10 0 0)
SF-OPTION _"Logo Fill Method" '("Color Fill" "Fill With Pattern" "Fill With Gradient")
SF-COLOR _"Logo Fill Color" '(23 131 181)
SF-PATTERN "Logo Fill Pattern" "Burlwood"
SF-GRADIENT "Logo Fill Gradient" "Yellow Orange"
SF-ENUM "Logo Gradient Mode" '("GradientType" "gradient-linear")
SF-OPTION "Gradient Blend Direction" list-blend-wksp-dir
SF-OPTION "Gradient Repeat" sfrepeat
SF-TOGGLE "Gradient Reverse" FALSE
SF-ADJUSTMENT _"Logo Bevel Depth" '(10 0 50 1 1 0 0)
SF-OPTION _"Stroke Fill Method" '("Color" "Pattern" "Gradient")
SF-COLOR _"Stroke Color" '(9 45 68)
SF-PATTERN "Stroke Pattern" "Wood #2"
SF-GRADIENT "Stroke Gradient" "Golden"
SF-ENUM "Stroke Gradient Mode" '("GradientType" "gradient-linear")
SF-OPTION "Gradient Blend Direction" list-blend-wksp-dir
SF-OPTION "Gradient Repeat" sfrepeat
SF-TOGGLE "Gradient Reverse" FALSE
SF-ADJUSTMENT _"Stroke width" '(3 0 19 1 1 0 0)
SF-COLOR _"Shadow color" '(0 0 0)
SF-ADJUSTMENT _"Shadow Offset X" '(-6 -99 99 1 1 0 0)
SF-ADJUSTMENT _"Shadow Offset Y" '(4 -99 99 1 1 0 0)
SF-ADJUSTMENT _"Shadow Opacity" '(50 0 100 1 1 0 0)
SF-OPTION _"Added Effect" '("None" "Bump With Pattern" "Simple Gloss Layer" "Translucent/Glass Layer" "Double Bevel" "Double Stroke" "Cubism on Fill" "Oilify on Fill" "Plasma on fill" "Glitter on fill" "Shined")
SF-PATTERN _"Added Effect Pattern" "Bricks"
SF-ADJUSTMENT _"Added Effect Depth" '(7 0 50 1 1 0 0)
SF-ADJUSTMENT "Buffer amount" '(10 0 100 1 10 1 0) ;a slider
SF-OPTION _"Background Fill Method" '("Color" "Pattern" "Gradient" "None")
SF-COLOR _"Background Color" '(255 255 255)
SF-PATTERN "Background Pattern" "Pine?"
SF-GRADIENT "Background Gradient" "Brushed Aluminium"
SF-ENUM "Back Gradient Mode" '("GradientType" "gradient-linear")
SF-OPTION "Gradient Blend Direction" list-blend-wksp-dir
SF-OPTION "Back Gradient Repeat" sfrepeat
SF-TOGGLE "Gradient Reverse" FALSE
SF-TOGGLE "Apply Vignette" FALSE
SF-COLOR "Vignette Color" '(0 0 0)
)
(script-fu-menu-register "script-fu-logo-workshop-plus-299d"
_"<Image>/File/Create/Logos/")