我对 Script-Fu 有点陌生,需要将分辨率从 600DPI 更改为 300DPI,然后将画布大小调整为 1000px W x 2000px H,同时保持实际图像大小不变。否则我的照片会被拉长。
我确信脚本应该与我找到的这个类似。但是这个特别抱怨我的图像被索引并且它想要一个 RGB 图像。我不想做的...
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;
; File = script-fu-grow-canvas.scm
; function name script-fu-grow-canvas
;
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;
( define
( script-fu-grow-canvas
theImage
theDrawable
)
;
(gimp-image-undo-group-start theImage)
( let*
(
; Define local variables
; imageWidth, imageHeight, centerX, centerY
; Measure the height and width of the image.
; Calculate the center
( imageWidth ( car ( gimp-drawable-width theDrawable )))
( imageHeight ( car ( gimp-drawable-height theDrawable )))
( centerX ( / imageWidth 2 ))
( centerY ( / imageHeight 2 ))
( tenthWidth ( / imageWidth 8 ))
( tenthHeight ( / imageHeight 8 ))
( borderx tenthWidth )
( bordery tenthHeight )
( newWidth 0 )
( newHeight 0 )
( dummyLayer 0 )
( layername "DummyLayer" )
;
) ; End of Variable Declaration
; if Aspect ratio widget is unchecked make X and Y
; length the greater of the two.
( set! newWidth ( + imageWidth ( * borderx 2 )))
( set! newHeight ( + imageHeight ( * bordery 2 )))
;
( set! dummyLayer (car ( gimp-layer-new
theImage
imageWidth
imageHeight
0
layername
10
0 ))
)
( gimp-image-add-layer theImage dummyLayer 1 )
( gimp-layer-resize dummyLayer
newWidth
newHeight
borderx
bordery )
( script-fu-para-tat-layer
theImage
dummyLayer
layername )
( gimp-image-resize-to-layers theImage )
;
( gimp-drawable-set-visible dummyLayer FALSE )
( gimp-image-set-active-layer theImage theDrawable )
) ; END let*
(gimp-image-undo-group-end theImage)
) ; END define
( script-fu-register "script-fu-grow-canvas" ; Function Name
"02 Expand Canvas" ; Menu Label
"Expand the image canvas based on image
size" ; Function Description
"Stephen Kiel" ; Author
"2011, Stephen Kiel" ; Copyright
"December 2011" ; Creation Date
"*" ; Valid Image Type
SF-IMAGE "theImage" 0
SF-DRAWABLE "theDrawable" 0
) ; End script-fu-register
( script-fu-menu-register
"script-fu-grow-canvas" "<Image>/Flowzilla/Flow - Standard")