File tree Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Original file line number Diff line number Diff line change 1
1
(define (resize-ris image
2
2
drawable
3
3
newwidth
4
- newheight)
4
+ newheight
5
+ method)
5
6
(let*
6
7
(
7
8
(drawable (car (gimp-image-active-drawable image)))
19
20
(gimp-layer-set-mode new-layer-2 LAYER-MODE-MULTIPLY-LEGACY)
20
21
(set! new-layer-1 (car (gimp-image-merge-down image new-layer-2 EXPAND-AS-NECESSARY)))
21
22
23
+ (cond
24
+ ((= method 0 )
25
+ (gimp-context-set-interpolation INTERPOLATION-CUBIC)
26
+ )
27
+ ((= method 1 )
28
+ (gimp-context-set-interpolation INTERPOLATION-NONE)
29
+ )
30
+ ((= method 2 )
31
+ (gimp-context-set-interpolation INTERPOLATION-LINEAR)
32
+ )
33
+ ((= method 3 )
34
+ (gimp-context-set-interpolation INTERPOLATION-CUBIC)
35
+ )
36
+ ((= method 4 )
37
+ (gimp-context-set-interpolation INTERPOLATION-NOHALO)
38
+ )
39
+ ((= method 5 )
40
+ (gimp-context-set-interpolation INTERPOLATION-LOHALO)
41
+ )
42
+ )
43
+
22
44
(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 )
45
+ (gimp-layer-scale new-layer-3 newwidth newheight TRUE )
46
+ (gimp-layer-scale new-layer-3 oldwidth oldheight TRUE )
25
47
26
48
(gimp-layer-set-mode new-layer-3 LAYER-MODE-DIVIDE-LEGACY)
27
49
(set! new-layer-1 (car (gimp-image-merge-down image new-layer-3 EXPAND-AS-NECESSARY)))
28
50
(gimp-item-set-name new-layer-1 " RIS" )
29
51
30
- (gimp-image-scale-full image newwidth newheight INTERPOLATION-CUBIC )
52
+ (gimp-image-scale image newwidth newheight)
31
53
32
54
(gimp-displays-flush)
33
55
46
68
SF-DRAWABLE " Drawable" 0
47
69
SF-VALUE " Width" " 1024"
48
70
SF-VALUE " Height" " 1024"
71
+ SF-OPTION " Method" ' (" Cubic" " None" " Linear" " Cubic" " NoHalo" " LowHalo" )
49
72
)
50
73
51
74
(script-fu-menu-register " resize-ris" " <Image>/Image/Transform" )
You can’t perform that action at this time.
0 commit comments