Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

GMIC, great discovery

General discussion about software packages and releases, new software you've found, and threads by programmers and script writers.
geaplanet
Posts: 24
Joined: 20 Jan 2015, 04:17
Number of books owned: 0
Country: spain

GMIC, great discovery

Post by geaplanet » 29 Apr 2015, 14:50

GMIC can apply filters to images really easily, and you can use it with a lot of files in a batch processing.
Here I used to clean the background without affecting letters.

Image
Image

aku
Posts: 46
Joined: 02 Jan 2010, 08:38
Number of books owned: 0
Location: Vancouver, BC

Re: GMIC, great discovery

Post by aku » 29 Apr 2015, 18:42

Are you talking about
http://gmic.eu/index.shtml
by chance ?

geaplanet
Posts: 24
Joined: 20 Jan 2015, 04:17
Number of books owned: 0
Country: spain

Re: GMIC, great discovery

Post by geaplanet » 30 Apr 2015, 02:19

@aku, yes.

I used in the "repair" category, the "ians noise reduction" filter.
In that category, there is another filter called "repair scanned documents", it does a good job too for getting a total white background, but I don't like totally colors result.

Fot batch treatment, take the command from gimp/gmip filter (verbose to the layer name), in my case -iain_iains_nr 3,3,1,0,0,0,1,0,0,0,1.35,0,0, and then run in a terminal something like that:

gmic *.jpg -iain_iains_nr 3,3,1,0,0,0,1,0,0,0,1.35,0,0 -o img.jpg

And that's all, jpg files in a folder will be created with the filter applied.

User avatar
dingodog
Posts: 106
Joined: 22 Jul 2010, 18:19
Number of books owned: 1000
Country: on the net
Location: on the net
Contact:

Re: GMIC, great discovery

Post by dingodog » 30 Apr 2015, 08:29

if you are running gmic in Linux, it would be very helpful to have gmic packaged as standalone package able to run (hopefully) on every linux distro, since compilation og gmic is not possible in older distro, while gmic is very useful

you need to download cde

http://www.pgbovine.net/cde.html

and package the gmic binary on your system with this syntax

Code: Select all

cde path...to/gmic
then you can upload the resulting gmic folder zipped somewhere

It would be very important and useful if you can do this attempt

geaplanet
Posts: 24
Joined: 20 Jan 2015, 04:17
Number of books owned: 0
Country: spain

Re: GMIC, great discovery

Post by geaplanet » 30 Apr 2015, 12:34

@Dingodog, what system do you use? I'm running linux in an old Debian Wheezy, I think it is 2012 ¿? And do you have gmic even in Squeeze repository.

User avatar
dingodog
Posts: 106
Joined: 22 Jul 2010, 18:19
Number of books owned: 1000
Country: on the net
Location: on the net
Contact:

Re: GMIC, great discovery

Post by dingodog » 30 Apr 2015, 17:12

first of all thanks for your reply (many thanks)

I'm currently running a distro (puppy linux 3.01) that is one of the few distro I found fully working on my outdated hardware (not to be snob :-)

I seen the list of dependencies to build gmic, it is not so long but very heavy!

libgimp2.0-dev
libcv-dev
libhighgui-dev
libcurl4-openssl-dev
libfftw3-dev

I'm unable to compile these dependencies with gcc 4.1.2 and the current environment with glibc 2.5

so I kindly asked you make a portable gmic using cde; cde is not perfect but fails rarely and works the most part of times, what cde does is create a folder in directory you invoke, with executable (gmic in this case) with all dependencies it is able to track, mainly using ldd to identify these and isolating these in a layer that theorically makes an executable so packaged working in any linux environment independently from system libs

if you run cde to create a standalone gmic, any can test the package so made

geaplanet
Posts: 24
Joined: 20 Jan 2015, 04:17
Number of books owned: 0
Country: spain

Re: GMIC, great discovery

Post by geaplanet » 30 Apr 2015, 17:45

I know about CDE and how it works, I talked to Philip Guo often years ago.
I'll try pack gmic with CDE, but if your machine is so old that you have to install puppylinux...processing images will be really heavy work for it. And don't forget "CDE packed apps" eat more RAM than normal compiled apps.

Only for curiosity, what machine do you have?

User avatar
dingodog
Posts: 106
Joined: 22 Jul 2010, 18:19
Number of books owned: 1000
Country: on the net
Location: on the net
Contact:

Re: GMIC, great discovery

Post by dingodog » 30 Apr 2015, 17:56

I currently own a

PENTIUM IV, 2,6 Ghz, with 2 Gb of Ram (a 32 bit system)

the machine itself it not so old, but I had problems with wifi with other distro, since 7 years, instead, puppy linux perfectly fits my needs

I'm aware that cde is not perfect, but it is a test worth to do in my opinion (many thanks in advance)

the real problem is that development environment of Puppy Linux 3.01 comes with gcc 4.1.2 (but this is not the real problem) the real issue is the very old glibc (2.5) that I cannot upgrade without break the whole system, otherwise I had already compiled gmic by myself

P.S. I have several build of jbig2enc built with special parameters, and especially one with a patch that allows (with the help of PIL image library) to do what googlebooks does in their scanning work (having in the same page a b/w and a grayscale representation of page image for details uncodable in b/w) this patch by Alexey Kryukov also adds the ability to select the number of pages for dictionary for jbig2 encoder

Code: Select all

  -d --duplicate-line-removal: use TPGD in generic region coder
  -p --pdf: produce PDF ready data
  -P <number> --pages-per-dict <number>: pages per dictionary (default 15)
  -s --symbol-mode: use text region, not generic coder
  -t <threshold>: set classification threshold for symbol coder (def: 0.85)
  -T <bw threshold>: set 1 bpp threshold (def: 188)
  -r --refine: use refinement (requires -s: lossless)
  -O <outfile>: dump thresholded image as PNG
  -2: upsample 2x before thresholding
  -4: upsample 4x before thresholding
  -S: remove images from mixed input and save separately
  -j --jpeg-output: write images from mixed input as JPEG
  -v: be verbose
I'll upload a stand-alone portable as soon as possible

no time tonight to make this portable, but maybe it can be working also without to portabilize the executable, you can try my build of this special version of jbig2enc with patch by Alexey Kryukov

http://d-h.st/QSh7

it comes with a modified pdf.py script downloadable from my site
http://dokupuppylinux.info/_media/progr ... ica-pdf.py

geaplanet
Posts: 24
Joined: 20 Jan 2015, 04:17
Number of books owned: 0
Country: spain

Re: GMIC, great discovery

Post by geaplanet » 30 Apr 2015, 18:46

Here you are: http://goo.gl/cDLTOQ

I don't know very well what you mean with that patch does, could you link an example?
I convert to pdf with pdfbeads, it chooses the best compressor for pages depending on their content.

geaplanet
Posts: 24
Joined: 20 Jan 2015, 04:17
Number of books owned: 0
Country: spain

Re: GMIC, great discovery

Post by geaplanet » 30 Apr 2015, 18:55

For my old PC I use picaros, it has a lot of software installed and a lot of drivers (for wifi too). It is based on minino, another lightweight debian distribution.
It is especially for kids, but in menu -> minino utilities -> desktop style, you can choose a "normal" desktop based in lxde. Even it has a lxde tuned with gnome2 look.
All desktop only eat 100Mb RAM! And you can install all debian software.
http://minino.galpon.org/en/descargas

Post Reply