Skip to content

Commit 91891b3

Browse files
committed
0.20250205: add Scheme script
1 parent 3a02e02 commit 91891b3

File tree

3 files changed

+75
-30
lines changed

3 files changed

+75
-30
lines changed

LICENSE

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
1-
Public Domain Mark 1.0
2-
No Copyright
3-
4-
This work has been identified as being free of known restrictions
5-
under copyright law, including all related and neighboring rights.
6-
7-
You can copy, modify, distribute and perform the work, even for
8-
commercial purposes, all without asking permission. See Other
9-
Information below.
10-
11-
Other Information
12-
13-
The work may not be free of known copyright restrictions in all
14-
jurisdictions.
15-
16-
Persons may have other rights in or related to the work, such as
17-
patent or trademark rights, and others may have rights in how the
18-
work is used, such as publicity or privacy rights.
19-
20-
In some jurisdictions moral rights of the author may persist beyond
21-
the term of copyright. These rights may include the right to be
22-
identified as the author and the right to object to derogatory
23-
treatments.
24-
25-
Unless expressly stated otherwise, the person who identified the work
26-
makes no warranties about the work, and disclaims liability for all
27-
uses of the work, to the fullest extent permitted by applicable law.
28-
29-
When using or citing the work, you should not imply endorsement by
30-
the author or the person who identified the work.
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <https://unlicense.org>
File renamed without changes.

scheme/resize-ris.scm

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
(define (resize-ris image
2+
drawable
3+
newwidth
4+
newheight)
5+
(let*
6+
(
7+
(drawable (car (gimp-image-active-drawable image)))
8+
(oldwidth (car (gimp-image-width image)))
9+
(oldheight (car (gimp-image-height image)))
10+
(new-layer-1 (car (gimp-layer-copy drawable TRUE)))
11+
(new-layer-2 (car (gimp-layer-copy drawable TRUE)))
12+
(new-layer-3 (car (gimp-layer-copy drawable TRUE)))
13+
)
14+
15+
(gimp-image-undo-group-start image)
16+
17+
(gimp-image-insert-layer image new-layer-1 0 -1)
18+
(gimp-image-insert-layer image new-layer-2 0 -1)
19+
(gimp-layer-set-mode new-layer-2 LAYER-MODE-MULTIPLY-LEGACY)
20+
(set! new-layer-1 (car (gimp-image-merge-down image new-layer-2 EXPAND-AS-NECESSARY)))
21+
22+
(gimp-image-insert-layer image new-layer-3 0 -1)
23+
(gimp-layer-scale new-layer-3 newwidth newheight INTERPOLATION-CUBIC)
24+
(gimp-layer-scale new-layer-3 oldwidth oldheight INTERPOLATION-CUBIC)
25+
26+
(gimp-layer-set-mode new-layer-3 LAYER-MODE-DIVIDE-LEGACY)
27+
(set! new-layer-1 (car (gimp-image-merge-down image new-layer-3 EXPAND-AS-NECESSARY)))
28+
(gimp-item-set-name new-layer-1 "RIS")
29+
30+
(gimp-image-scale-full image newwidth newheight INTERPOLATION-CUBIC)
31+
32+
(gimp-displays-flush)
33+
34+
(gimp-image-undo-group-end image)
35+
)
36+
)
37+
38+
(script-fu-register "resize-ris"
39+
"_Resize RIS"
40+
"Resize used RIS (Reverse Interpolate Scale)"
41+
"zvezdochiot https://github.com/zvezdochiot"
42+
"This is free and unencumbered software released into the public domain."
43+
"2025-02-05"
44+
"*"
45+
SF-IMAGE "Image" 0
46+
SF-DRAWABLE "Drawable" 0
47+
SF-VALUE "Width" "1024"
48+
SF-VALUE "Height" "1024"
49+
)
50+
51+
(script-fu-menu-register "resize-ris" "<Image>/Image/Transform")

0 commit comments

Comments
 (0)