You are here

How to use twain-acquire in a script-fu and afterwards use gimp-threshold to process the acquired image?

Hi

I am a newbie into using GIMP and especially script-fu. I have tried to read the manual on script-fu but I have not been able figure out what I am doing wrong. My aim is to write a script-fu that automates the following thing for me:

Here is what I do manually:
1: First I acquire a gray scale image in 300 dpi with my HP1220 scanner/laserprinter
2: Threshold (to convert to an black and white image)
3: Autocrop Image (to reduce size)
4: Reduce bits per pixel to 1 (to reduce filesize)
5. Save the resulting image as a *.tiff CCITT Group 4 fax image (to minimize file size)

The purpose is to scan a receipt and store it on the computer for use with Gnucash accounting program

I have been playing around with the script-fu console and I think I have found the functions that I need which is: (twain-acquire run-mode)
(gimp-threshold drawable low-threshold high-threshold)
(plug-in-autocrop run-mode image drawable)
(gimp-image-convert-indexed image dither-type palette-type num-cols alpha-dither remove-unused palette)
(file-tiff-save run-mode image drawable filename raw-filename compression)

But I have only been able to acquire the scan with the following sentence:
> (vector-ref (cadr(twain-acquire 0)) 0)
1
When I try to apply the threshold command nothing happens to the image?
> (gimp-threshold 1 200 255)
(#t)
I am quite confused about what is a drawable and a image? Reading the script-fu online help has not really helped me.

I not asking for someone to write the script for me just some advice that can help me advance

I have of course also been looking for an already made script but I have not been able to find anything

Subscribe to Comments for "How to use twain-acquire in a script-fu and afterwards use gimp-threshold to process the acquired image?"