Page 3 of 3

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

Posted: 08 Oct 2011, 17:43
by eL_PuSHeR
Here is a sample I have just scanned.

600dpi - 2bpp

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

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

Posted: 08 Oct 2011, 18:03
by dingodog
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

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

Posted: 09 Oct 2011, 03:12
by eL_PuSHeR
@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.

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

Posted: 09 Oct 2011, 06:04
by Tulon
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.

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

Posted: 09 Oct 2011, 08:46
by dingodog
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)

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

Posted: 09 Oct 2011, 09:23
by Tulon
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.

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

Posted: 09 Oct 2011, 15:11
by eL_PuSHeR
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.

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

Posted: 09 Oct 2011, 16:34
by Tulon
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.

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

Posted: 09 Oct 2011, 16:59
by eL_PuSHeR
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.

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

Posted: 11 Oct 2011, 15:29
by eL_PuSHeR
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: