1997-11-24 22:05:25 +00:00
|
|
|
; CARVE-IT
|
|
|
|
; Carving, embossing, & stamping
|
|
|
|
; Process taken from "The Photoshop 3 WOW! Book"
|
|
|
|
; http://www.peachpit.com
|
|
|
|
; This script requires a grayscale image containing a single layer.
|
|
|
|
; This layer is used as the mask for the carving effect
|
1998-05-31 06:49:20 +00:00
|
|
|
; NOTE: This script requires the image to be carved to either be an
|
2013-06-06 23:26:16 +02:00
|
|
|
; RGB color or grayscale image with a single layer. An indexed file
|
2019-07-14 13:59:11 +02:00
|
|
|
; can not be used due to the use of gimp-drawable-histogram and
|
|
|
|
; gimp-drawable-levels.
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
(define (carve-scale val scale)
|
|
|
|
(* (sqrt val) scale))
|
|
|
|
|
|
|
|
(define (calculate-inset-gamma img layer)
|
2019-07-14 13:59:11 +02:00
|
|
|
(let* ((stats (gimp-drawable-histogram layer 0 0.0 1.0))
|
2006-10-16 01:08:54 +00:00
|
|
|
(mean (car stats)))
|
1997-11-24 22:05:25 +00:00
|
|
|
(cond ((< mean 127) (+ 1.0 (* 0.5 (/ (- 127 mean) 127.0))))
|
2006-10-16 01:08:54 +00:00
|
|
|
((>= mean 127) (- 1.0 (* 0.5 (/ (- mean 127) 127.0)))))))
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1998-01-29 03:13:44 +00:00
|
|
|
|
|
|
|
(define (copy-layer-carve-it dest-image dest-drawable source-image source-drawable)
|
|
|
|
(gimp-selection-all dest-image)
|
2018-04-16 20:12:12 +02:00
|
|
|
(gimp-drawable-edit-clear dest-drawable)
|
1998-01-29 03:13:44 +00:00
|
|
|
(gimp-selection-none dest-image)
|
|
|
|
(gimp-selection-all source-image)
|
2024-10-25 19:19:19 +02:00
|
|
|
(gimp-edit-copy (vector source-drawable))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
(let* (
|
2024-10-25 19:19:19 +02:00
|
|
|
(pasted (car (gimp-edit-paste dest-drawable FALSE)))
|
|
|
|
(floating-sel (vector-ref pasted (- (vector-length pasted) 1)))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
)
|
|
|
|
(gimp-floating-sel-anchor floating-sel)
|
|
|
|
)
|
|
|
|
)
|
1998-01-29 03:13:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-12 19:01:15 +00:00
|
|
|
(define (script-fu-carve-it bg-img bg-layers mask-img mask-drawable carve-white)
|
2006-10-16 01:08:54 +00:00
|
|
|
(let* (
|
2024-09-12 19:01:15 +00:00
|
|
|
(src-layer (vector-ref bg-layers 0))
|
2021-04-20 17:47:11 +02:00
|
|
|
(width (car (gimp-drawable-get-width mask-drawable)))
|
|
|
|
(height (car (gimp-drawable-get-height mask-drawable)))
|
2024-09-12 19:01:15 +00:00
|
|
|
(type (car (gimp-drawable-type src-layer)))
|
2006-10-16 01:08:54 +00:00
|
|
|
(img (car (gimp-image-new width height (cond ((= type RGB-IMAGE) RGB)
|
|
|
|
((= type RGBA-IMAGE) RGB)
|
|
|
|
((= type GRAY-IMAGE) GRAY)
|
|
|
|
((= type GRAYA-IMAGE) GRAY)
|
|
|
|
((= type INDEXED-IMAGE) INDEXED)
|
|
|
|
((= type INDEXEDA-IMAGE) INDEXED)))))
|
|
|
|
(size (min width height))
|
|
|
|
(offx (carve-scale size 0.33))
|
|
|
|
(offy (carve-scale size 0.25))
|
|
|
|
(feather (carve-scale size 0.3))
|
|
|
|
(brush-size (carve-scale size 0.3))
|
2023-12-09 11:02:10 -05:00
|
|
|
(brush (car (gimp-brush-new "Carve It")))
|
2024-09-27 17:10:46 +02:00
|
|
|
(mask (car (gimp-channel-new img "Engraving Mask" width height 50 '(0 0 0))))
|
2024-09-12 19:01:15 +00:00
|
|
|
(inset-gamma (calculate-inset-gamma (car (gimp-item-get-image src-layer)) src-layer))
|
2006-10-16 01:08:54 +00:00
|
|
|
(mask-fat 0)
|
|
|
|
(mask-emboss 0)
|
|
|
|
(mask-highlight 0)
|
|
|
|
(mask-shadow 0)
|
|
|
|
(shadow-layer 0)
|
|
|
|
(highlight-layer 0)
|
|
|
|
(cast-shadow-layer 0)
|
|
|
|
(csl-mask 0)
|
|
|
|
(inset-layer 0)
|
|
|
|
(il-mask 0)
|
2024-09-12 19:01:15 +00:00
|
|
|
(bg-width (car (gimp-drawable-get-width src-layer)))
|
|
|
|
(bg-height (car (gimp-drawable-get-height src-layer)))
|
|
|
|
(bg-type (car (gimp-drawable-type src-layer)))
|
|
|
|
(bg-image (car (gimp-item-get-image src-layer)))
|
2025-01-20 20:35:58 +01:00
|
|
|
(layer1 (car (gimp-layer-new img "Layer1" bg-width bg-height bg-type 100 LAYER-MODE-NORMAL)))
|
2006-10-16 01:08:54 +00:00
|
|
|
)
|
2004-09-22 17:27:20 +00:00
|
|
|
|
|
|
|
(gimp-context-push)
|
2011-11-09 02:42:34 -05:00
|
|
|
(gimp-context-set-defaults)
|
2004-09-22 17:27:20 +00:00
|
|
|
|
1999-10-17 00:07:55 +00:00
|
|
|
(gimp-image-undo-disable img)
|
2004-11-11 13:59:18 +00:00
|
|
|
|
2011-03-02 02:55:43 -05:00
|
|
|
(gimp-image-insert-layer img layer1 0 0)
|
2004-11-11 13:59:18 +00:00
|
|
|
|
1998-01-29 03:13:44 +00:00
|
|
|
(gimp-selection-all img)
|
2018-04-16 20:12:12 +02:00
|
|
|
(gimp-drawable-edit-clear layer1)
|
1998-01-29 03:13:44 +00:00
|
|
|
(gimp-selection-none img)
|
2024-09-12 19:01:15 +00:00
|
|
|
(copy-layer-carve-it img layer1 bg-image src-layer)
|
1998-01-29 03:13:44 +00:00
|
|
|
|
2024-10-25 19:19:19 +02:00
|
|
|
(gimp-edit-copy (vector mask-drawable))
|
2010-09-28 09:10:07 +04:00
|
|
|
(gimp-image-insert-channel img mask -1 0)
|
1998-01-29 03:13:44 +00:00
|
|
|
|
2024-10-25 19:19:19 +02:00
|
|
|
(plug-in-tile RUN-NONINTERACTIVE img (vector layer1) width height FALSE)
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
(let* (
|
2024-10-25 19:19:19 +02:00
|
|
|
(pasted (car (gimp-edit-paste mask FALSE)))
|
|
|
|
(floating-sel (vector-ref pasted(- (vector-length pasted) 1)))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
)
|
|
|
|
(gimp-floating-sel-anchor floating-sel)
|
|
|
|
)
|
1997-11-24 22:05:25 +00:00
|
|
|
(if (= carve-white FALSE)
|
2017-09-03 21:28:47 +02:00
|
|
|
(gimp-drawable-invert mask FALSE))
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
(set! mask-fat (car (gimp-channel-copy mask)))
|
2010-09-28 09:10:07 +04:00
|
|
|
(gimp-image-insert-channel img mask-fat -1 0)
|
2011-02-21 00:07:19 +02:00
|
|
|
(gimp-image-select-item img CHANNEL-OP-REPLACE mask-fat)
|
2019-07-14 13:59:11 +02:00
|
|
|
|
2023-12-09 11:02:10 -05:00
|
|
|
(gimp-brush-set-shape brush BRUSH-GENERATED-CIRCLE)
|
|
|
|
(gimp-brush-set-spikes brush 2)
|
|
|
|
(gimp-brush-set-hardness brush 1.0)
|
|
|
|
(gimp-brush-set-spacing brush 25)
|
|
|
|
(gimp-brush-set-aspect-ratio brush 1)
|
|
|
|
(gimp-brush-set-angle brush 0)
|
|
|
|
(cond (<= brush-size 17) (gimp-brush-set-radius brush (\ brush-size 2))
|
|
|
|
(else gimp-brush-set-radius brush (\ 19 2)))
|
|
|
|
(gimp-context-set-brush brush)
|
2019-07-14 13:59:11 +02:00
|
|
|
|
2004-09-22 18:43:09 +00:00
|
|
|
(gimp-context-set-foreground '(255 255 255))
|
2018-04-16 20:12:12 +02:00
|
|
|
(gimp-drawable-edit-stroke-selection mask-fat)
|
1997-11-24 22:05:25 +00:00
|
|
|
(gimp-selection-none img)
|
|
|
|
|
|
|
|
(set! mask-emboss (car (gimp-channel-copy mask-fat)))
|
2010-09-28 09:10:07 +04:00
|
|
|
(gimp-image-insert-channel img mask-emboss -1 0)
|
2024-12-15 19:30:20 +01:00
|
|
|
(gimp-drawable-merge-new-filter mask-emboss "gegl:gaussian-blur" 0 LAYER-MODE-REPLACE 1.0 "std-dev-x" (* 0.32 feather) "std-dev-y" (* 0.32 feather) "filter" "auto")
|
2024-12-16 00:58:59 +01:00
|
|
|
(gimp-drawable-merge-new-filter mask-emboss "gegl:emboss" 0 LAYER-MODE-REPLACE 1.0 "azimuth" 315.0 "elevation" 45.0 "depth" 7 "type" "emboss")
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2004-09-22 18:43:09 +00:00
|
|
|
(gimp-context-set-background '(180 180 180))
|
2011-02-21 00:07:19 +02:00
|
|
|
(gimp-image-select-item img CHANNEL-OP-REPLACE mask-fat)
|
1997-11-24 22:05:25 +00:00
|
|
|
(gimp-selection-invert img)
|
2018-04-16 20:12:12 +02:00
|
|
|
(gimp-drawable-edit-fill mask-emboss FILL-BACKGROUND)
|
2011-02-21 00:07:19 +02:00
|
|
|
(gimp-image-select-item img CHANNEL-OP-REPLACE mask)
|
2018-04-16 20:12:12 +02:00
|
|
|
(gimp-drawable-edit-fill mask-emboss FILL-BACKGROUND)
|
1997-11-24 22:05:25 +00:00
|
|
|
(gimp-selection-none img)
|
|
|
|
|
|
|
|
(set! mask-highlight (car (gimp-channel-copy mask-emboss)))
|
2010-09-28 09:10:07 +04:00
|
|
|
(gimp-image-insert-channel img mask-highlight -1 0)
|
2019-07-14 13:59:11 +02:00
|
|
|
(gimp-drawable-levels mask-highlight 0
|
|
|
|
0.7056 1.0 TRUE
|
|
|
|
1.0
|
|
|
|
0.0 1.0 TRUE)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
(set! mask-shadow mask-emboss)
|
2019-07-14 13:59:11 +02:00
|
|
|
(gimp-drawable-levels mask-shadow 0
|
|
|
|
0.0 0.70586 TRUE
|
|
|
|
1.0
|
|
|
|
0.0 1.0 TRUE)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2024-10-25 19:19:19 +02:00
|
|
|
(gimp-edit-copy (vector mask-shadow))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
(let* (
|
2024-10-25 19:19:19 +02:00
|
|
|
(pasted (car (gimp-edit-paste layer1 FALSE)))
|
|
|
|
(floating-sel (vector-ref pasted (- (vector-length pasted) 1)))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
)
|
|
|
|
(set! shadow-layer floating-sel)
|
|
|
|
(gimp-floating-sel-to-layer shadow-layer)
|
|
|
|
)
|
2017-01-09 20:37:30 +01:00
|
|
|
(gimp-layer-set-mode shadow-layer LAYER-MODE-MULTIPLY)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2024-10-25 19:19:19 +02:00
|
|
|
(gimp-edit-copy (vector mask-highlight))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
(let* (
|
2024-10-25 19:19:19 +02:00
|
|
|
(pasted (car (gimp-edit-paste shadow-layer FALSE)))
|
|
|
|
(floating-sel (vector-ref pasted (- (vector-length pasted) 1)))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
)
|
|
|
|
(set! highlight-layer floating-sel)
|
|
|
|
(gimp-floating-sel-to-layer highlight-layer)
|
|
|
|
)
|
2017-01-09 20:37:30 +01:00
|
|
|
(gimp-layer-set-mode highlight-layer LAYER-MODE-SCREEN)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2024-10-25 19:19:19 +02:00
|
|
|
(gimp-edit-copy (vector mask))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
(let* (
|
2024-10-25 19:19:19 +02:00
|
|
|
(pasted (car (gimp-edit-paste highlight-layer FALSE)))
|
|
|
|
(floating-sel (vector-ref pasted (- (vector-length pasted) 1)))
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
)
|
|
|
|
(set! cast-shadow-layer floating-sel)
|
|
|
|
(gimp-floating-sel-to-layer cast-shadow-layer)
|
|
|
|
)
|
2017-01-09 20:37:30 +01:00
|
|
|
(gimp-layer-set-mode cast-shadow-layer LAYER-MODE-MULTIPLY)
|
1997-11-24 22:05:25 +00:00
|
|
|
(gimp-layer-set-opacity cast-shadow-layer 75)
|
Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.
This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.
This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.
The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.
As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 16:40:19 -04:00
|
|
|
|
2024-12-15 19:30:20 +01:00
|
|
|
(gimp-drawable-merge-new-filter cast-shadow-layer "gegl:gaussian-blur" 0 LAYER-MODE-REPLACE 1.0 "std-dev-x" (* 0.32 feather) "std-dev-y" (* 0.32 feather) "filter" "auto")
|
2018-04-23 15:49:23 +02:00
|
|
|
(gimp-item-transform-translate cast-shadow-layer offx offy)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2017-01-09 20:37:30 +01:00
|
|
|
(set! csl-mask (car (gimp-layer-create-mask cast-shadow-layer ADD-MASK-BLACK)))
|
2003-12-08 22:33:17 +00:00
|
|
|
(gimp-layer-add-mask cast-shadow-layer csl-mask)
|
2011-02-21 00:07:19 +02:00
|
|
|
(gimp-image-select-item img CHANNEL-OP-REPLACE mask)
|
2004-09-22 18:43:09 +00:00
|
|
|
(gimp-context-set-background '(255 255 255))
|
2018-04-16 20:12:12 +02:00
|
|
|
(gimp-drawable-edit-fill csl-mask FILL-BACKGROUND)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2004-11-11 13:59:18 +00:00
|
|
|
(set! inset-layer (car (gimp-layer-copy layer1 TRUE)))
|
2011-03-02 02:55:43 -05:00
|
|
|
(gimp-image-insert-layer img inset-layer 0 1)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2017-01-09 20:37:30 +01:00
|
|
|
(set! il-mask (car (gimp-layer-create-mask inset-layer ADD-MASK-BLACK)))
|
2003-12-08 22:33:17 +00:00
|
|
|
(gimp-layer-add-mask inset-layer il-mask)
|
2011-02-21 00:07:19 +02:00
|
|
|
(gimp-image-select-item img CHANNEL-OP-REPLACE mask)
|
2004-09-22 18:43:09 +00:00
|
|
|
(gimp-context-set-background '(255 255 255))
|
2018-04-16 20:12:12 +02:00
|
|
|
(gimp-drawable-edit-fill il-mask FILL-BACKGROUND)
|
1997-11-24 22:05:25 +00:00
|
|
|
(gimp-selection-none img)
|
1998-01-29 03:13:44 +00:00
|
|
|
(gimp-selection-none bg-image)
|
2019-07-14 13:59:11 +02:00
|
|
|
(gimp-drawable-levels inset-layer 0 0.0 1.0 TRUE inset-gamma 0.0 1.0 TRUE)
|
1997-11-24 22:05:25 +00:00
|
|
|
(gimp-image-remove-channel img mask)
|
|
|
|
(gimp-image-remove-channel img mask-fat)
|
|
|
|
(gimp-image-remove-channel img mask-highlight)
|
|
|
|
(gimp-image-remove-channel img mask-shadow)
|
|
|
|
|
2010-10-10 03:41:21 +04:00
|
|
|
(gimp-item-set-name layer1 _"Carved Surface")
|
|
|
|
(gimp-item-set-name shadow-layer _"Bevel Shadow")
|
|
|
|
(gimp-item-set-name highlight-layer _"Bevel Highlight")
|
|
|
|
(gimp-item-set-name cast-shadow-layer _"Cast Shadow")
|
|
|
|
(gimp-item-set-name inset-layer _"Inset")
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2023-12-09 11:02:10 -05:00
|
|
|
(gimp-resource-delete brush)
|
2019-07-14 13:59:11 +02:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
(gimp-display-new img)
|
2004-09-22 17:27:20 +00:00
|
|
|
(gimp-image-undo-enable img)
|
|
|
|
|
2006-10-16 01:08:54 +00:00
|
|
|
(gimp-context-pop)
|
|
|
|
)
|
|
|
|
)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2024-09-12 19:01:15 +00:00
|
|
|
(script-fu-register-filter "script-fu-carve-it"
|
2006-10-16 01:08:54 +00:00
|
|
|
_"Stencil C_arve..."
|
2012-10-07 16:40:40 +02:00
|
|
|
_"Use the specified drawable as a stencil to carve from the specified image."
|
2006-10-16 01:08:54 +00:00
|
|
|
"Spencer Kimball"
|
|
|
|
"Spencer Kimball"
|
|
|
|
"1997"
|
|
|
|
"GRAY"
|
2024-09-12 19:01:15 +00:00
|
|
|
SF-ONE-OR-MORE-DRAWABLE
|
2006-10-16 01:08:54 +00:00
|
|
|
SF-IMAGE "Mask image" 0
|
2024-09-29 00:05:19 +02:00
|
|
|
SF-DRAWABLE _"Mask drawable" 0
|
2006-10-16 01:08:54 +00:00
|
|
|
SF-TOGGLE _"Carve white areas" TRUE
|
|
|
|
)
|
2004-11-18 22:44:28 +00:00
|
|
|
|
|
|
|
(script-fu-menu-register "script-fu-carve-it"
|
2006-10-16 01:08:54 +00:00
|
|
|
"<Image>/Filters/Decor")
|