Batch Despeckle?

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

Post Reply
bdragon
Posts: 108
Joined: Mon May 01, 2017 8:06 am

Batch Despeckle?

Post by bdragon »

Okay, is it already there?
lately i've been asking for stuff that was already there so this time i'm directly asking if i can't see the obvious again.
cday
XnThusiast
Posts: 3976
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Batch Despeckle?

Post by cday »

bdragon wrote:Okay, is it already there?
lately i've been asking for stuff that was already there so this time i'm directly asking if i can't see the obvious again.
You try the Filter > Reduce noise action, although the setting isn't adjustable, and I have no personal experience of using it; you might also if necessary test some of the other filter options, although it seems unlikely any would actually be useful...
bdragon
Posts: 108
Joined: Mon May 01, 2017 8:06 am

Re: Batch Despeckle?

Post by bdragon »

it appears to work only on very low resolution scans/pictures, and the appearance chance is not very noticeable. I don't know f this is intentional to avoid unditting "i"s :D
cday
XnThusiast
Posts: 3976
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Batch Despeckle?

Post by cday »

bdragon wrote:it appears to work only on very low resolution scans/pictures, and the appearance chance is not very noticeable. I don't know f this is intentional to avoid unditting "i"s :D
Commercial OCR software generally have despeckle functions as does Nuance PaperPort, which could be a lower cost route to obtaining the function if you don't need heavyweight OCR.

If you are comfortable using the command line, the obvious answer is ImageMagick which supports despeckle in its very extensive function set.
bdragon
Posts: 108
Joined: Mon May 01, 2017 8:06 am

Re: Batch Despeckle?

Post by bdragon »

First: this is the forum for XnConvert. I already knew about those softwares, i was asking specifically of this.

Also what i ask is not "making coffee" or other things unrelated to the scope of the original software. So it might already be there as it happened with several requests i asked in the past, only i did not know they had different names.

Yes i don't scans extensively, only about once or twice a month.

And i'm generous in the use of the "scan" word. Half of that is just cleaning with GIMP "pictures people have taken of printed words" which yeah they are some vague sort of a scan but i'm not going to insult scanners in saying those are scans.

But i like what little i actually do "scan" to be rather neatly contrasted, devoid of useless borders and deskewed.

XnView and XnConvert already do the vast majority of that as i slowly learned.

Now i just changed printer. It's an office printer, A Ricoh Aficio MP 2000. Old. Used. And refurbished. Basically very fast, very cheap can print and scan A3 and sold at one third of the price. However. While this "new" one is much faster, as expected of a printer for an office... whatever i scan does not seem to come out "cleaned". There seem to be countless microscopic imperfections which prevent such useful features as "auto-crop" to work in any fashion.

Apparently is toner build-up on the other side of the scanner glass, and whatever i do does not appear to come off. Yes this includes removing the glass and going there with a solvent. Also it's too dark for normal "threshold" with the autocrop. I'm attaching a picture of a scan.

So yeah. I could say i've wasted 500 euros on a printer which is fast but gets its scans all dirty because i was cheap... or i could use several softwares on a batch process to do all the sequence of works... or... well... i thought that there was a forum, that this software was made to do batch processes and i could ... you know... ask?

Let me know.
Attachments
Capture.JPG
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Batch Despeckle?

Post by XnTriq »

Median as well as Minimum/Maximum filters are available in XnConvert and can also be used for removing noise.
bdragon
Posts: 108
Joined: Mon May 01, 2017 8:06 am

Re: Batch Despeckle?

Post by bdragon »

:D
See?
Just ask.
I'll try them later.
Thanks.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Batch Despeckle?

Post by XnTriq »

I noticed a halftone or dither pattern in your screenshot.

Is the Original key on the scanner set to Original Type 1 (Text) or Original Type 1 (Photo) (see page #110 in the operating instructions)?

I also downloaded the TWAIN driver for the Ricoh Aficio MP 2000 and extracted the help file: In the Quality Settings, there seems to be an Erase Background option “for scanning newspapers or documents printed on colored paper, since it removes some background texture”.
p144395.png
p144395.png (9.77 KiB) Viewed 2400 times
Photo Pattern in Scan Settings Windows[Details] Dialog Box[Basic] TabSettings in the [Advanced] Dialog Box allows you to “specify the type of photo (dither) pattern to use when the [Col./Grad.] is set to [Binary (Photo)]. Each photo (dither) pattern has its own characteristic effect. Experiment with several to find one that fits your requirements.”

Edit: Sorry, I hadn't realized that you apply Bayer ordered dithering during color depth reduction :-|

Links of interest:
  • Jens Gulden: unpaper
    “unpaper is a post-processing tool for scanned sheets of paper, especially for book-pages scanned from previously created photocopies. unpaper tries to remove dark edges, corrects the rotation ("deskew"), and aligns the centering of pages.”
  • ImageMagick (as mentioned by cday)
  • Acrobat Library
  • XnView Forum
bdragon
Posts: 108
Joined: Mon May 01, 2017 8:06 am

Re: Batch Despeckle?

Post by bdragon »

First of all thanks for going so indept.

The scanner is set to do basic grayscale by itself and then save as a tif to my NAS which i... well... straight connected to it and then to the repeater. This is because the previous printer had me set the page, then go back two rooms where i have the pc, scan it, then go back two rooms to the printer, set it to scan, and so on.

Sorry, but since i have a disability i cannot have a printer in the same room with me. It's... well let's just say the doctors said i can't have many more pieces hacked away and so anything as cancerogenous as a laser printer has to be in a different room, possibly with a large window that has to be open whenever i want to start using the printer. (which, incidentally, is also why i tend to have sooo many "scanned" pictures which are just pictures of a page taken by phone).

So yes, the one thing i liked about this printer that made it so fast was that i could just scan without using the PC and it would save to the NAS next to it. Which meant i would just have to go there once, set the pages, tell it to scan, and then i would find the pages slowly working their ways into the NAS.

Basically i have a room for me and a completely different room with the printed archive i use for work and the printer. So yes. This is also why, while i do have the TWAIN driver installed, i haven't used it yet.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Batch Despeckle?

Post by XnTriq »

bdragon wrote:It's... well let's just say the doctors said i can't have many more pieces hacked away and so anything as cancerogenous as a laser printer has to be in a different room, possibly with a large window that has to be open whenever i want to start using the printer.
Sounds like a piece of advice I should take into consideration myself :mrgreen:

So you've set up an unattended scanning system using an automatic document feeder and your NAS, bypassing the TWAIN driver. Unfortunately, that Erase Background is done by the software and seems not to be available in the firmware.

Could you please try applying the action for removing the speckles (Reduce Noise) before dithering (Change color depth)? I believe this would yield better results.
bdragon
Posts: 108
Joined: Mon May 01, 2017 8:06 am

Re: Batch Despeckle?

Post by bdragon »

ok, i'll try
bdragon
Posts: 108
Joined: Mon May 01, 2017 8:06 am

Re: Batch Despeckle?

Post by bdragon »

here's my latest configuration version for XnConvert when "cleaning" scans. the greatest differences i did find in the past was moving the reduce noice below normalize EX or adjust brightness. But even then in general i did find little difference. I don't know the algorithm for "reduce noise" but seems to work best on very low res. The scans i was working on right now were about 9500x6500 originally A3 scanned pages, then auto-cropped to their borders.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?><XnView_script version="1.0" name="st-conv-Text">
    <Reduce_noise/>
    <Change_color_depth method="2" dither="1" ncompo="256" alpha="255"/>
    <Normalize_Ex value1="20" value2="20" value3="3"/>
    <Adjust brightness="20" contrast="20" gamma="0.10000000000000001"/>
    <Equalize/>
    <Median_box size="3"/>
    <Maximum size="3"/>
    <Automatic_deskew color="#ffffff"/>
    <Automatic_contrast/>
    <Automatic_levels/>
    <Automatic_crop method="1" position="0" color="#ffffff" tolerance="90"/>
    <Set_DPI x="150" y="150" keep="false"/>
    <Clean_metadata flags="63"/>
    <Output folder="" filename="{Filename}" case="7" format="JPEG">
        <Options overwrite="3" orgDate="true" keepMeta="false" keepICC="false" keepFolder="true" keepParentFolder="false" delOrg="true" multipage="true" allPages="true" openExplorer="false" openBrowser="false" clearItems="true"/>
        <JPEG quality="75" progressive="true" optimizeHuffman="true" rebuildThumb="false" orgQuality="true" DCTMethod="0" subSampling="2" smoothFactor="0"/>
    </Output>
</XnView_script>
Also, while normally i don't use this for work i appreciate the help and since this specific scan was for work i'm buying XnView MP right now. XnConvert requires only a donation... and i don't like how much information the guys want just to send me to my paypal.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Batch Despeckle?

Post by XnTriq »

bdragon wrote:Also, while normally i don't use this for work i appreciate the help and since this specific scan was for work i'm buying XnView MP right now.
Pierre will be glad to hear that :-D
bdragon wrote:I don't know the algorithm for "reduce noise" but seems to work best on very low res.
It's mainly aimed at removing ISO noise, I believe. A dedicated despeckle filter would sure be appreciated by a lot of users, especially for batch processing.
  • E-Health Laboratory: Toolboxes → Image Despeckle Filtering Algorithms
Post Reply