GIMP :: Reconciling Script-fu Interactive And Batch Arguments
Aug 29, 2013
How to properly write a script which is usable in both interactive and batch modes.
Let's say I have a script-fu add-on:
(define (add-watermark orgImg drw watermarkFileName relHt opacity)...
)
(script-fu-register
"add-watermark"
"Add Watermark..."
[Code] ......
As written above, with the
SF-MODE "Mode" "RUN-INTERACTIVE" SF-STRING "Main image file" ""
arguments commented out, this script works in interactive mode,operating on the active drawable in the active image;the first two arguments to the function (orgImg and drw) are filled in automagically by the gimp when the script is activated.
The only way I have figured out how to use this from batch mode is toadd another script which contains the name of the base file to process:
(define (batch-add-watermark inFileName watermarkFileName outFileName relHt opacity) (let* (
(orgImg (car (gimp-file-load RUN-NONINTERACTIVE inFileName inFileName))) (drw (car (gimp-image-get-active-layer orgImg))) )
(add-watermark orgImg drw watermarkFileName relHt opacity) (gimp-file-save RUN-NONINTERACTIVE orgImg drw outFileName outFileName) (gimp-image-delete orgImg)
)
)
This works, but neither procedure is making any use of what should be the first argument (missing from add-watermark above but present in batch-add-watermark) which is the mode.
View 1 Replies
ADVERTISEMENT
Sep 11, 2012
I'm working with a plugin that I need to edit the source code so it can run in NONINTERACTIVE mode. I have no problem compiling it from source - in fact have modified to suit our needs already - but cannot not grasp from GIMP documentation what modifications I need to make it run in NONINTERACTIVE mode. (We have very large images, need to batch process them ....)
View 5 Replies
View Related
Aug 5, 2013
I'm doing an script in python and i need use the map-object plug-in. I tried to use but always i have an error with the arguments and i can´t find out whats wrong.
I used reference examples of scm but didn't work, so one in python will be enough.
View 4 Replies
View Related
Feb 7, 2014
I got off to a bad start setting up my library. I have too many catalogs, numerous redundancies from misimportations, and am beginning to have difficulty finding files when I need them. What is the best way to reorganize my library without making matters worse? Also is there a best practice for keeping it simple, transparent, and cohesive? I wish I could start over again, but I already have 4-5 thousand images (though some are clearly duplicates).
View 2 Replies
View Related
Jan 28, 2013
I sometimes get a error message stating 'invalid arguments specified when working with database...' (see attachment). What causes these and can I fix them? The file opens and seems to work ok.
IV 2012, 64 bit, SP-2
Win 7, 8 gb, Quadro 1000m
View 3 Replies
View Related
Jun 25, 2013
I prepared a code to calculate number of days between two date.
I want to know how can I define negligible arguments for my lisp routins. It means if I omitted the arguments, lisp code can handle it without any errors ("; error: too few arguments")
In this case, my program defined as: (TotalDays 1st_date 2nd_date)
(TotalDays 1978 03 21 2013 06 25)
and I want to have flexibility: if I use this routine as (TotalDays 1978 03 21), the program should substitute today's date with second date.
I know if I put "nil" instead of date for 2nd_date, It will not be an error, because:
(if (and y2 m2 d2) (setq n2 (GetJDN y2 m2 d2))(setq n2 (fix (getvar "DATE"))))
but that's not my favourite!, how can I omitted 2nd_date completely? as (TotalDays 1978 03 21)
Here is my lisp
;|How to use:(TotalDays 1978 03 21 2013 06 25)|;;;;;By Abbas Aqdam(defun TotalDays ( y1 m1 d1 y2 m2 d2 / n1 n2)(setq n1 (GetJDN y1 m1 d1))(if (and y2 m2 d2) (setq n2 (GetJDN y2 m2 d2))(setq n2 (fix (getvar "DATE"))))(abs(- n1 n2)));;;;Leap years are included;;;;By Abbas Aqdam(defun GetJDN ( year month day / a y m J)(setq a (/(- 14 Month) 12))(setq y (-(+ year 4800) a))(setq m (-(+ Month (* 12 a)) 3))(setq J (-(+ day (/(+(* 153 m) 2)5) (* 365 y) (/ y 4) (/ y 400)) (/ y 100) 32045)))
View 9 Replies
View Related
May 19, 2010
I have a lot of xcf's which I want to save as png's and do not want to do this manually in Gimp.
How do a batch convert xcf to png using the terminal (linux)?
Needs to be through Gimp CLI as ImageMagick convert won't handle the files properly and i can't get xcf2png to work.
View 8 Replies
View Related
Aug 1, 2013
I am trying to use gimp in batch mode. I can't find any examples of how to do _real_ batch processing. All the examples on the net show how to integrate into the gui.
I see that I can use the -b flag to invoke script-fu functions. But AFAICS,the script with the function definitions needs to reside somewhere in~/gimp-x.y/scripts or something.
In addition, I can't find a way to pass command line arguments to the called functions. Is there any way to define/execute functions? For example, I'd like to callsimple-unsharp-mask from [URL]........
like this:
$ call-gimp-function script.scm simple-unsharp-mask file.png 5.0 0.5 0
View 17 Replies
View Related
Mar 14, 2011
I have a folder of lots of images i want to resize for the web. Is there a decent batch plug in for gimp 2.6.10. I am using ubuntu.
View 8 Replies
View Related
Jul 20, 2011
I have a ton of TGAs that could use RLE. I was looking for a batch conversion option in the GIMP file menu that I could use to convert uncompressed TGA's to compressed TGA's, but I couldn't find one. How would I batch compress TGA's then?
View 2 Replies
View Related
May 11, 2012
I am starting a decal business and i have jpg's of all the decal designs in black on a white background. I need to batch colorize a bunch of images, i figured out how to do it individually and save but i need to colorize all the images in a folder and save with a different name. i found a great script to batch convert jpgs to pngs, and am trying to edit it to work.
i think just the line in red needs to be written correctly.
(define (colorize it DirectoryName)
(let*
(
(fileExtension ".jpg") ; we are looking for .jpg files
(varFileList (cadr (file-glob (string-append DirectoryName DIR-SEPARATOR "*" fileExtension) 1) ) ) ; find them all
[code]........
View 4 Replies
View Related
Apr 21, 2013
When using command line gimp, is it possible to use *.jpg as the file name to have it process ALL the JPEG files in a folder? I'm really actuallyinterested in a simple file format conversion with no image processingapplied, specifically svg2png conversion. I know Gimp can render svg andcan save png, and unlike the next best program ImageMagick, the Gimpactually DOES NOT GLITCH the resulting image! So I've got a folder FULL OFSVG FILES, and would like to be able to just type "gimp convert -i *.svg-outputformat png" and have have it AUTOMATICALLY convert all my svg filesto png files. Is it possible to do this with such a simple and shortcommand line? I know the above exact example command line doesn't work,cause I tried it. But is there some simillarly simple command line code Icould use with gimp to convert svg to png via rendering the svg and thensaving the image as a png?
View 4 Replies
View Related
Sep 7, 2011
How can do batch numbering over my pictures?
Like this
to put numbers(1,2,3...22,23) on the photos.
View 2 Replies
View Related
Sep 16, 2011
I have over 200 pdf files that I need to batch convert to tiff format. From what I've gathered, this can be done simply using Ghostscript. Unfortunately, I have no experience running GS as a command line program, and only installed it as part of Gimp. Any tool for gimp that could do this? or step by step, through the process of using GS to perform this task?
View 1 Replies
View Related
Jan 6, 2013
Gimp does unsharp mask of 0.1 radius, but unfortunately the batch processors only allow 2+ pixel radius. E.g. upres.
View 8 Replies
View Related
Jan 25, 2013
I need to convert from bitmap images to PNGs with the command line. I've tried looking into script-fu, but lisp is one of those languages I could never figure out.
I've tried using imagemagick, but it did not properly convert the images. The images are apparently 32bit Windows Bitmap V3 files with an alpha channel; according to a page I found on google, imagemagick will not preserve the alpha channel in this particular case. I don't know for certain if that's the actual reason why imagemagick isn't working, but it definitely isn't working. It does, however, work if done manually in gimp.
This is going to be part of a python script, so I need it to convert a specific bitmap file rather than all the ones in a directory.
View 6 Replies
View Related
Oct 17, 2011
I want to do batch processing of 460 .png files. It includes rescaling their width to 50% without interpolation, changing color mode to indexed based on a specified palette, changing color mode to RGB and rescaling their width to 200%.
View 1 Replies
View Related
Sep 9, 2011
Ιs possible batch numbering over my pictures?
like this:
How do I get on the images progressively numbered (1,2,3,4...35,36,37 .... ).
View 9 Replies
View Related
Jan 19, 2014
I am wanting to make a batch file that automates the task of scanning in photos.
Here is what I currently do: I scan in one or two pictures into the same file. I then open the scanned in image in GIMP, and then use the Divide Scanned Images plugin in combination with the Deskew plugin to create an output of two seperate image files.
This is quite a tedious task, especially with the 1000+ stack of photos that I have.
I already have a script that automates the process of scanning in the image for me, but I really need a script that opens GIMP, and runs the Divide Scanned Images plugin, preferably without the GIMP user-interface.
View 1 Replies
View Related
Oct 15, 2012
I have created a script to convert in a batch, about 2000 images, the problem is that gimp-file-save ignores image settings and uses its own defaults, so the image that has 6 layers, after being scaled, has only one layer!
the image is in format dds I am using gimp 2.8.2
the script:
(define (SECresizeTexture filename width height)(let* ((img (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))(drawable (car (gimp-image-get-active-drawable img))))(gimp-image-scale img width height)(gimp-file-save RUN-NONINTERACTIVE img drawable filename filename)))
as you can see, this is a generic script, I would like to avoid using the specific dds load/save because of increased complexity and for being specific to dds...
is it possible to set some format based on the original file? I could use the dds file save, parsing output from "identify -verbose filename" (imagemagick), but that will be a lot of trouble...
View 12 Replies
View Related
May 23, 2012
I have done LOTS of detailed research into ppi, dpi etc.
I believe I do understand the difference. Whenever I open a picture in gimp it opens at 72ppi. I wish to scale all my photos to 300 ppi so i can use a template I made of the exact same size paper as my printer uses without having to worry about the printer rescaling my photos from 72 ppi to whatever dpi it needs.
I have converted lots manually and am assured that this works for my purposes (not professional just scrapbook and photo album prints)
I have two questions though;
1. Is there a freeware program, or a way through gimp, that I can batch convert multiple files up to 300ppi.
2. Why when I change the ppi of a photo does the filesize become larger? Surely the ppi is just a reference number to know how many pixels to display and to convert for printing?
View 5 Replies
View Related
Sep 22, 2012
Where the output of (display ...) in a script goes when running in batch mode?
View 1 Replies
View Related
Apr 19, 2013
for question A : how to chain or unchain, lets say 8 frames in 1 shot ?
for question B : how to delete frame, lets say 5 frames in 1 shot ? Any short cut key?
View 1 Replies
View Related
Jun 20, 2012
Is it possible to open an image in the clipboard with batch mode?
i.e. File > Create > From Clipboard
GIMP 2.8
View 2 Replies
View Related
Feb 10, 2009
I am attempting to set up a batch that automatically runs gimp-curves-spline on a set of images. However, I have never used Scheme before and therefore am not sure why my script is returning "batch command experienced an execution error"
Here is the command I am using to call the script(via a windows .bat file)
gimp-2.6.exe -i --verbose -b "(color-curve "C:\gimpbatchtest\*.tiff")" -b "(gimp-quit 0)"
And the script itself:
(define (color-curve pattern) (let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist)) (let* ((filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(gimp-curves-spline RUN-NONINTERACTIVE image HISTOGRAM-VALUE 3 '(0 0 64 200 128 46))
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)) (set! filelist (cdr filelist)))))
View 6 Replies
View Related
Mar 1, 2012
I am a newbie having trouble getting the sample batch programs to run. I placed simple-unsharp-mask.scm in C:.gimp-2.6scripts and put the .bat file in the E: drive directory with the image file foo.png. When I run the .bat file on my PC running Vista, I get "batch command experienced an execution error." Here is the .bat file:
"C:Program FilesGIMP-2.0ingimp-2.6.exe" -i -b "(simple-unsharp-mask "foo.png" 5.0 0.5 0)" -b "(gimp-quit 0)"
Obviously, I am doing something wrong, but don't have a clue what it is?
View 12 Replies
View Related
Apr 22, 2012
I want to be able to use a windows batch file to create a gradient for gimp.
My code is: Code ........
View 1 Replies
View Related
Jun 8, 2011
I have about 10,000 photos that were taken with cell phone camera. I have to sharpen and save. They are photos of pages of books. Is there a way to make batch file of every 100 or so of the photos and edit them?
View 1 Replies
View Related
Jun 21, 2013
I have about 160-ish images I scanned in as .tif's (my scanner offers .bmp, .jpg, .png, and .tif for saving scanned images as) @ 300-dpi. I'd like to batch export them all to .xcf (for future working with) and .png (I know I could have chose png to start but I thought .tif would be the better choice as a first format). Is it possible to do this with a shell-script? I'm fairly certain I could concoct something to .tif -> .png using ImageMagick (I don't think it supports .xcf) but I'd like to use The GIMP for the whole process if possible, and I'd rather not do it by hand. As it is I'm going to have to figure out how to batch-rename (well, I know how I'm going to do it, a shell script, but how to write it is going to be the tough part for me) about 100 if the images to prepend a 0 to the file name (I started with a two-digit numbering system not realizing I had so many images and would like to keep all the names listing properly on FreeBSD).
Anyway, If such a shell export-to-xcf-and-png script is even possible (I really, really do not want to do this manually).
View 6 Replies
View Related
Sep 20, 2012
Is there a way to do batch process of converting .jpg or .tif images from RGB to CMYK?
View 2 Replies
View Related
Nov 6, 2013
I have a series of images with alpha channels what I want to separate out from the images and save as a new file with a filename suffix.
For example I have a series of folders containing thousands of images:
These files are filename.dds files (I already have the .dds plugin to read them but you could use .png for example).
I load the image, goto Colours - > Components - > Decompose :
In the dialogue I enter color model : Alpha, tick decompose to layers - > OK
I then export the file as filename_a.jpg
Is there a way to batch this process for the 1000's of images I have?
View 1 Replies
View Related