A Photography forum. PhotoBanter.com

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PhotoBanter.com forum » Digital Photography » Digital Photography
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Wrote a GIMP extension to do scaling, EXACTLY what I want



 
 
Thread Tools Display Modes
  #1  
Old June 2nd 08, 07:57 PM posted to comp.graphics.apps.gimp,rec.photo.digital,comp.lang.scheme
Ignoramus27711
external usenet poster
 
Posts: 6
Default Wrote a GIMP extension to do scaling, EXACTLY what I want

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/
  #2  
Old June 25th 08, 12:23 AM posted to comp.graphics.apps.gimp,rec.photo.digital,comp.lang.scheme
Dirk Hartmann
external usenet poster
 
Posts: 1
Default Wrote a GIMP extension to do scaling, EXACTLY what I want

Ignoramus27711 wrote:

This extension provides four functions for changing image size:

Ignoramus27711 wrote:

Hello Igor,

good example how to write a script-fu for your own needs. But if someone
wants to scale many pictures I propose David's Batch Processor
http://members.ozemail.com.au/~hodsond/dbp.html The advantage: I always
have to sharpen the results and this plug-in makes it possible.

Dirk Hartmann
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I Predict Image Scaling With of Photofinisher Prints? kc Digital Photography 5 March 24th 07 07:34 PM
Irby! Do you remember what I wrote about computers? cyrusthevirus Digital Photography 0 March 9th 07 07:07 AM
Image Sizing/Scaling - Photshop CS BobS Digital Photography 4 December 28th 04 07:35 AM
Robert Monaghan; i love this thing you wrote! Mike Henley Medium Format Photography Equipment 2 July 1st 04 12:45 AM
I wrote a Digital Imaging Glossary for myself... phil Taylor Digital Photo Equipment For Sale 0 November 10th 03 05:36 PM


All times are GMT +1. The time now is 02:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PhotoBanter.com.
The comments are property of their posters.