First of all, I want to express my gratitude for your wonderful tool. nconvert has been around for a long time. It has become indispensable in my work due to its simplicity and powerful batch image processing capabilities.
However, I am faced with the need to perform adaptive image binarization, which is currently missing from the nconvert functionality. Adaptive binarization is an important operation for processing images with uneven illumination, and its addition it would significantly expand the capabilities of your tool.
I would like to propose an implementation of the adaptive binarization command with three parameters:
1. Radius is a parameter that determines the size of the area for calculating the local threshold (from 4 to 100).
2. Smooth is a parameter that regulates the degree of smoothing of the image before binarization (from 0 to 100).
3. Binarize is the threshold value for binarization (from 0 to 255).
Example of using the command:
nconvert -adaptive_binarize radius=20 smooth=50 threshold=128 input.jpg -o output.png
Such a feature would be extremely useful for tasks of processing scanned documents, text recognition and other tasks where adaptive binarization is required. I would really appreciate it if you would consider adding this feature in future versions of nconvert. If you need additional information or usage examples, I am ready to provide them.
Thank you for your attention and for your hard work!
Add adaptive binarization function to nconvert
Moderators: helmut, XnTriq, xnview
-
- Posts: 39
- Joined: Sun Sep 15, 2019 5:14 pm
-
- Author of XnView
- Posts: 45967
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 39
- Joined: Sun Sep 15, 2019 5:14 pm
Re: Add adaptive binarization function to nconvert
I am sending you a link to an archive with sample files for adaptive binarization. The link is valid for 14 days. I am ready to provide additional information and explanations.
https://dropmefiles.com/u428h
https://dropmefiles.com/u428h
-
- Author of XnView
- Posts: 45967
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 39
- Joined: Sun Sep 15, 2019 5:14 pm
Re: Add adaptive binarization function to nconvert
Good afternoon!
I put the sample file in the new storage.
https://drive.google.com/file/d/1BLX7GO ... drive_link
I put the sample file in the new storage.
https://drive.google.com/file/d/1BLX7GO ... drive_link
-
- XnThusiast
- Posts: 4374
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Add adaptive binarization function to nconvert
You need to use the Google Drive option to make the link available to anyone, otherwise Pierre will have to request access from you.
-
- Posts: 39
- Joined: Sun Sep 15, 2019 5:14 pm
Re: Add adaptive binarization function to nconvert
Opened access for everyone.
-
- Posts: 12
- Joined: Sun Mar 22, 2020 2:11 pm
Re: Add adaptive binarization function to nconvert
Скорее всего вам нужно воспользоваться программой ScanKromsator. Поищете его на руборд.ком.
Также существуют консольный бинаризатор входящий в Potrace (MKbitmap) potrace.sourceforge.net
English:
Most likely you need to use the program ScanKromsator. Look for it on ru-board.com.
There is also a console binarizer included in Potrace (MKbitmap) potrace.sourceforge.net
Также существуют консольный бинаризатор входящий в Potrace (MKbitmap) potrace.sourceforge.net
English:
Most likely you need to use the program ScanKromsator. Look for it on ru-board.com.
There is also a console binarizer included in Potrace (MKbitmap) potrace.sourceforge.net
-
- Posts: 39
- Joined: Sun Sep 15, 2019 5:14 pm
Re: Add adaptive binarization function to nconvert
Спасибо, обязательно посмотрю и попробую данные программы. Давно использую nconvert и хотелось бы иметь в одном пакете все необходимые инструменты.
Thanks, I will definitely take a look and try these programs. I've been using nconvert for a long time and would love to have all the tools I need in one package.

Thanks, I will definitely take a look and try these programs. I've been using nconvert for a long time and would love to have all the tools I need in one package.

-
- Author of XnView
- Posts: 45967
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Add adaptive binarization function to nconvert
could you put output that you would like to have?
Pierre.
-
- Posts: 39
- Joined: Sun Sep 15, 2019 5:14 pm
Re: Add adaptive binarization function to nconvert
If I understood your question correctly, the output file is in TIF black and white.
-
- Posts: 12
- Joined: Sun Mar 22, 2020 2:11 pm
Re: Add adaptive binarization function to nconvert
Вероятно Пьер имел ввиду, чтобы вы нафотошопили примерно ожидаемый результат, как он должен выглядеть (техзадание так сказать)SAMSAM wrote: Tue Apr 15, 2025 10:52 am If I understood your question correctly, the output file is in TIF black and white.
Возможно вы ожидаете примерно такой результат:
https://workupload.com/file/B72vP9rWGjL
In English:
Pierre probably meant that you would "photoshop" the expected result, how it should look (technical specifications, so to speak)
Perhaps you expect something like this:
https://workupload.com/file/B72vP9rWGjL
-
- Posts: 39
- Joined: Sun Sep 15, 2019 5:14 pm
Re: Add adaptive binarization function to nconvert
In addition to what was presented earlier. A video on the difference between the two binarization methods can be viewed here.
https://workupload.com/file/H2Fz8RNPdB7
Willing to provide additional information.
https://workupload.com/file/H2Fz8RNPdB7
Willing to provide additional information.