Page 1 of 1

Add adaptive binarization function to nconvert

Posted: Sat Feb 01, 2025 2:44 pm
by SAMSAM
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!

Re: Add adaptive binarization function to nconvert

Posted: Sun Mar 30, 2025 11:36 am
by xnview
yes, please provide some examples

Re: Add adaptive binarization function to nconvert

Posted: Mon Mar 31, 2025 10:42 am
by SAMSAM
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

Re: Add adaptive binarization function to nconvert

Posted: Mon Apr 14, 2025 11:27 am
by xnview
sorry but your link doesnt work

Re: Add adaptive binarization function to nconvert

Posted: Mon Apr 14, 2025 4:06 pm
by SAMSAM
Good afternoon!
I put the sample file in the new storage.
https://drive.google.com/file/d/1BLX7GO ... drive_link

Re: Add adaptive binarization function to nconvert

Posted: Mon Apr 14, 2025 4:18 pm
by cday
You need to use the Google Drive option to make the link available to anyone, otherwise Pierre will have to request access from you.

Re: Add adaptive binarization function to nconvert

Posted: Mon Apr 14, 2025 5:25 pm
by SAMSAM
Opened access for everyone.

Re: Add adaptive binarization function to nconvert

Posted: Mon Apr 14, 2025 11:50 pm
by anfvan6
Скорее всего вам нужно воспользоваться программой 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

Re: Add adaptive binarization function to nconvert

Posted: Tue Apr 15, 2025 9:34 am
by SAMSAM
Спасибо, обязательно посмотрю и попробую данные программы. Давно использую 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. :)

Re: Add adaptive binarization function to nconvert

Posted: Tue Apr 15, 2025 10:41 am
by xnview
could you put output that you would like to have?

Re: Add adaptive binarization function to nconvert

Posted: Tue Apr 15, 2025 10:52 am
by SAMSAM
If I understood your question correctly, the output file is in TIF black and white.

Re: Add adaptive binarization function to nconvert

Posted: Tue Apr 15, 2025 2:29 pm
by anfvan6
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

Re: Add adaptive binarization function to nconvert

Posted: Tue Apr 15, 2025 4:42 pm
by SAMSAM
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.