[Gimp-user] crop to content

Late last night I got the latest version of the script suggested by
Rich and
tried it on a dozen color photo scans with borders. Each was left with
"white" strips along the sides and top and bottom, mostly thicker at
one end
than the other, indicating there was still a little skew left in the
(though the script does a deskew). I'll need to vary the parameters,
and also
try the original version of the script that Rich used.


The divide scanned images script can use a separate compiled plugin deskew.exe
but no guarantee it will work correctly. Even older than the script. I have
tried it in Win10 and it does work (I usually use linux)

However going by the sample image, that is not the problem, the actual picture
area is not rectangular, if the side is vertical the top is not horizontal. Your
scanner has already made a good job of de-skewing. I think you already know

If you can get it down to a minimum border, then any excess can be trimmed. 
Manually it is:  Select All - Stroke Selection - Zealous Crop - Select None

I have knocked up a small python script (trim_it.py)  to apply that procedure.
It trims off about 8 pixels from the edges. Edit the script for more / less.
Find bottom of the tools menu.

If you need to batch,  then it is either run in command line, or use in the only
up-to-date GUI Gimp batch plugin BIMP see:

Attached the two plugins zipped. 

Unzip and put both  in C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\plug-ins

* https://www.gimpusers.com/system/attachments/1355/original/trim.zip

rich404 (via www.gimpusers.com/forums)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]