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

B/W source - how to keep format?

Scan Tailor specific announcements, releases, workflows, tips, etc. NO FEATURE REQUESTS IN THIS FORUM, please.
eL_PuSHeR
Posts: 125
Joined: 28 Jun 2010, 15:25

Re: B/W source - how to keep format?

Post by eL_PuSHeR » 08 Oct 2011, 17:43

Here is a sample I have just scanned.

600dpi - 2bpp

http://imageshack.us/photo/my-images/37/sampleqj.png/

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: B/W source - how to keep format?

Post by dingodog » 08 Oct 2011, 18:03

blurred with radious = 3 (gaussian blur)

result (using jbig2enc):

Code: Select all

jbig2 -s -p -v -T 135 blurred.png && pdf.py output>out.pdf
- http://ifile.it/ce8nh3w

minimum blurring geometry needed to erase noise derived from improper scanning (for imagemagick convert and gm convert from graphicsmagick, seems to be 2x2)

Code: Select all

gm convert -blur 2x2 sampleqj.png blurred.png

eL_PuSHeR
Posts: 125
Joined: 28 Jun 2010, 15:25

Re: B/W source - how to keep format?

Post by eL_PuSHeR » 09 Oct 2011, 03:12

@dingodog:

The sample you posted is the same output I get from Scan Tailor's BW output. That's not what I want. What I want is to preserve all original pixels in the bitmap which is already 2bpp (stucki dithering).

Scan Tailor's method seems okay for b/w text but it's not suitable for b/w gradients/dithering patterns.

Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: B/W source - how to keep format?

Post by Tulon » 09 Oct 2011, 06:04

eL_PuSHeR wrote:Scan Tailor's method seems okay for b/w text but it's not suitable for b/w gradients/dithering patterns.
That's true.

You shouldn't scan in B/W anyway. By doing so, you lose valuable information that Scan Tailor could use. Scan in grayscale and use the Mixed mode for pictures. For cover pages, use Color / Grayscale mode.
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.

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: B/W source - how to keep format?

Post by dingodog » 09 Oct 2011, 08:46

since filesize depends, in 1bit (b/w) images, principally from quantity of information (and any pixel is an information) it is a very good idea to scan with dither in b/w... (ironic mode)

Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: B/W source - how to keep format?

Post by Tulon » 09 Oct 2011, 09:23

dingodog wrote:since filesize depends, in 1bit (b/w) images, principally from quantity of information (and any pixel is an information) it is a very good idea to scan with dither in b/w... (ironic mode)
Irony aside, I think it's worth to provide a serious and verbose answer, which is what I am going to do.

The usual book-scanning workflow is:
1. Scan or photograph a book.
2. Process with Scan Tailor.
3. Assemble into a PDF or a DJVU file, giving you a small file.
4. Discard Scan Tailor output files, but keep the project file.
5. Wait a bit, in case you discover a problem, like a badly-segmented picture.
6. If so, go to step 2.
7. If not, discard the raw scans.

So, in the end you are going to discard both the raw and processed scans, which is why you shouldn't worry about their sizes.
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.

eL_PuSHeR
Posts: 125
Joined: 28 Jun 2010, 15:25

Re: B/W source - how to keep format?

Post by eL_PuSHeR » 09 Oct 2011, 15:11

Tulon and everyone. Thank you very much for your replies but I think you misunderstood me.

Size is not a "big" problem. My main concern is resolution. I want to scan at 600dpi but my scanner won't go beyond 425dpi in grayscale mode. Another issue that I have is that it only uses JPEG compression for grayscale (8bpp)/true colour (24bpp) modes so I have forced it to work without compression. Thus, scanning times become tiresome when scanning 300dpi+ (8/24bpp). I have found out that 600 dpi / 1bpp gives me a good tradeoff between quality (specially for text printed later) and scanning speed, but what I don't understand is why ST changes b/w output if source is already 1bpp. Care to elaborate a bit?

I am making some more tests with 1bpp but containing only plain text. I think ST will do nicely this time. But when gradients, photographs are present I will have to resort to 300dpi/8bpp.

As always, any ideas would be greatly appreciated.

Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: B/W source - how to keep format?

Post by Tulon » 09 Oct 2011, 16:34

eL_PuSHeR wrote: why ST changes b/w output if source is already 1bpp
Most often it's impossible to preserve the "one to one" relationship between input and output pixels. For example, any non-zero rotation on the Deskew stage will make that impossible. Therefore, Scan Tailor doesn't even try.
eL_PuSHeR wrote:I am making some more tests with 1bpp but containing only plain text. I think ST will do nicely this time. But when gradients, photographs are present I will have to resort to 300dpi/8bpp.
That's what I was going to suggest. Another option is to scan in 1bpp and output in Mixed mode.
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.

eL_PuSHeR
Posts: 125
Joined: 28 Jun 2010, 15:25

Re: B/W source - how to keep format?

Post by eL_PuSHeR » 09 Oct 2011, 16:59

Thanks Tulon. I didn't take into account rotating operations using other than 90º angles.

As for Mixed Mode I admit I have made just a few tests. I will take this option into consideration for further testing.

eL_PuSHeR
Posts: 125
Joined: 28 Jun 2010, 15:25

Re: B/W source - how to keep format?

Post by eL_PuSHeR » 11 Oct 2011, 15:29

I have came up with a nerdy workaround workflow that will prove useful to me

+ Scan at 300dpi b/w or 3bpp colour using error-diffusion
+ apply some soften filters until image appears nice and convert it to grayscale/true colour (taking advantage of the human visual system)
+ apply some unsharp mask (USM) to remove part of the blurriness associated with the above softening
+ Process files with ST saving as grayscale/colour

And you are done. I have made several b/w and colour tests and the printed output is quite good.

:lol:

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests