Can anybody advise if there is the capability in GIMP to trace the outline of an image and crop it accordingly - I am trying to get rid of the white box that normally surrounds an image after cropping it.
Thanks in advance for any help.
you can't have box around after cropping the image, is absolutely not normal
That may happen only if you crop only the layer ,not the image
Simple solution is use Image/crop to selection
If you are trying to remove the background, this script:
Select white area with magic wand. Grow selection by 2px or so. Invert selection, press delete on keyboard.
Then you should be able to autocrop the image just fine :D
I copied transbg.scm to c:\Users\username\.gimp-2.6\scripts\transbg.scm
However, I'm not seeing it in Script-Fu (refreshed/restarted)
How is this script enabled and called up?
In windows/search you may have a dumb default:
"hide extension for commune file"
If that is checked extensions as jpg and HERE THE POINT as .txt
will be hidden
So you will never notice VISTA adding a txt extension to your .scm file...as you may have not notice that when saving anything similar to a text, as a code, you have not 1 but 2 option
first and very visible is save as .txt, the second, a bit more hidden,(do you know dropdown list? ..you click and more option pop out ) is save as "ALL FILES " and is that correct.
For Microsoft save as "all files" means "save as it is do not change file extension "...
So change that dumb default and download again, this time saving as "all files"
I'll check into this, thanks :-)
How is this used? (of course, once I get it enabled)
In other words, when I have an image in the editor, where can I find this tool in the editor?
The script will show up under Layers->Transparency.
I am using Transbg.scm in script-Fu and it is working perfectly. I need exact script to run for many files and therefore I made a batch program from it. The batch runs on Windows Vista normally, but none of the images are being changed. I don't know what I am doing wrong. I need your advice. Would you please give me suggestion how can I fix it.
This is the script:
(define (script-fu-batch-trans-bg pattern inThresh inSize inHoles)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image)))
(BGColour (car (gimp-image-pick-color image drawable 0 0 FALSE FALSE 0)))
; add alpha to layer if not exists
(if (equal? (car (gimp-drawable-has-alpha drawable)) FALSE)
(dupLayer (car (gimp-layer-copy drawable TRUE)))
(origSel (car (gimp-selection-save image)))
(gimp-image-add-layer image dupLayer -1)
; colour to alpha on dupLayer
(plug-in-colortoalpha RUN-NONINTERACTIVE image dupLayer BGColour)
(if (equal? inHoles TRUE)
(gimp-by-color-select drawable BGColour inThresh CHANNEL-OP-REPLACE TRUE FALSE 0 FALSE)
(gimp-fuzzy-select drawable 0 0 inThresh CHANNEL-OP-REPLACE FALSE 0 FALSE)
; grow selection by inSize
(gimp-selection-grow image inSize)
(gimp-edit-fill drawable FOREGROUND-FILL)
;merge down dupLayer to drawable... might have to play with layer names
(gimp-image-set-active-layer image (car (gimp-image-merge-down image dupLayer CLIP-TO-IMAGE)))
(gimp-image-remove-channel image origSel)
image drawable filename filename)
(set! filelist (cdr filelist))
Run it on command line:
Gimp-2.6 --verbose -i -b "(script-fu-batch-trans-bg \"D:/test/*.png\" 25 1 TRUE)" -b "(gimp-quit 0)"
The console message:
Starting extension: 'extension-script-fu'
No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
batch command executed successfully
Thank you in advance for your help
I am using Transbg.scm in script-Fu and it is working perfectly. I need exact script to run for many files and therefore I made a batch program from it. The batch runs on Windows Vista normally, but none of the images are being changed. I don't know what I am doing wrong. I need your advice. Would you please give me suggestion and comments.
forget first reply, "crop" confused me i call that "cut"
if you have no transparency but white is because your imagine has no alpha (= transparency ) channel
you may add it from Layer/transparency/add alpha channel
you may try if the ffat script speed up, but know about of the transparency channel (alpha channel) is important
No alpha= no transparency= added solid color (that active for BG )
Unless otherwise noted, the rights for the individual plugins are with their respective authors. Logo image by Jakub Steiner.