This extension provides four functions for changing image size:
1) Decrease size by 15%: ","
2) Increase size by 15%: "."
3) Decrease size 2x: "Alt-,"
4) Increase size 2x: "Alt-."
Then I defined four keyboard shortcuts mentioned in quotes above and
now I have the EXACT functions that I had in xv.
I am a very happy GIMP user now, because I know that I can automate
what I do in the way I want. I have no clue about Scheme, but I am a
computer programmer and I can do "intelligent cut and paste from
google".
Source code follows:
######################################################################
;; Image rescaling. Copyright (C) Igor Chudov, Licensed under GPL 2.0
(define (script-fu-rescale img
factor
)
;; rescale
(gimp-image-scale img
(* (car (gimp-image-width img)) factor)
(* (car (gimp-image-height img)) factor)
)
;; Flush the display
(gimp-displays-flush)
)
(define (script-fu-rescale-up img)
(script-fu-rescale img 1.15)
)
(define (script-fu-rescale-down img)
(script-fu-rescale img 0.8695)
)
(define (script-fu-rescale-up2x img)
(script-fu-rescale img 2)
)
(define (script-fu-rescale-down2x img)
(script-fu-rescale img 0.5)
)
(script-fu-register "script-fu-rescale-up"
"Rescale Up 15%"
"Rescale Up 15%"
"Igor Chudov"
"Igor Chudov"
"2008"
"RGB*, GRAY*"
SF-IMAGE "Image" 0
)
(script-fu-menu-register "script-fu-rescale-up"
"<Image>/Script-Fu/Rescale")
(script-fu-register "script-fu-rescale-down"
"Rescale Down 15%"
"Rescale Down 15%"
"Igor Chudov"
"Igor Chudov"
"2008"
"RGB*, GRAY*"
SF-IMAGE "Image" 0
)
(script-fu-menu-register "script-fu-rescale-down"
"<Image>/Script-Fu/Rescale")
;;;;;;;;;;;;;;;;;;;;;;;;;;;
(script-fu-register "script-fu-rescale-up2x"
"Rescale Up 2X"
"Rescale Up 2X"
"Igor Chudov"
"Igor Chudov"
"2008"
"RGB*, GRAY*"
SF-IMAGE "Image" 0
)
(script-fu-menu-register "script-fu-rescale-up2x"
"<Image>/Script-Fu/Rescale")
(script-fu-register "script-fu-rescale-down2x"
"Rescale Down 2X"
"Rescale Down 2X"
"Igor Chudov"
"Igor Chudov"
"2008"
"RGB*, GRAY*"
SF-IMAGE "Image" 0
)
(script-fu-menu-register "script-fu-rescale-down2x"
"<Image>/Script-Fu/Rescale")
--
Due to extreme spam originating from Google Groups, and their
inattention
to spammers, I and many others block all articles originating
from Google Groups. If you want your postings to be seen by
more readers you will need to find a different means of
posting on Usenet.
http://improve-usenet.org/


|