comparison mupdf-source/thirdparty/leptonica/README.md @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 # Leptonica Library #
2
3 [![sw](https://github.com/DanBloomberg/leptonica/actions/workflows/sw.yml/badge.svg)](https://github.com/DanBloomberg/leptonica/actions/workflows/sw.yml)
4
5 www.leptonica.org
6
7 ## The library supports many operations that are useful on ##
8
9 * Document images
10 * Natural images
11
12 ## Fundamental image processing and image analysis operations ##
13
14 * Rasterop (aka bitblt)
15 * Affine transforms (scaling, translation, rotation, shear) on images of arbitrary pixel depth
16 * Projective and bilinear transforms
17 * Binary and grayscale morphology, rank order filters, and convolution
18 * Seedfill and connected components
19 * Image transformations with changes in pixel depth, both at the same scale and with scale change
20 * Pixelwise masking, blending, enhancement, arithmetic ops, etc.
21
22 ## Ancillary utilities ##
23
24 * I/O for standard image formats (_jpg_, _png_, _tiff_, _webp_, _jp2_, _bmp_, _pnm_, _gif_, _ps_, _pdf_)
25 * Utilities to handle arrays of image-related data types (e.g., _pixa_, _boxa_, _pta_)
26 * Utilities for stacks, generic arrays, queues, heaps, lists, sets, ordered maps, hashmaps; number and string arrays; etc.
27
28 ## Examples of some applications enabled and implemented ##
29
30 * Octcube-based color quantization (w/ and w/out dithering)
31 * Modified median cut color quantization (w/ and w/out dithering)
32 * Determination of skew and orientation of text images
33 * Adaptive background normalization and binarization
34 * Segmentation of page images with mixed text and images
35 * Color segmentation by clustering and seed-filling
36 * Location of baselines and local skew determination
37 * jbig2 unsupervised classifier
38 * Border representations of 1 bpp images and raster conversion for SVG
39 * Postscript generation (levels 1, 2 and 3) of images for device-independent output
40 * PDF generation (G4, DCT, FLATE) of images for device-independent output
41 * Connectivity-preserving thinning and thickening of 1 bpp images
42 * Image warping (captcha, stereoscopic)
43 * Image dewarping based on content (textlines)
44 * Watershed transform
45 * Greedy splitting of components into rectangles
46 * Location of largest fg or bg rectangles in 1 bpp images
47 * Search for least-cost paths on binary and grayscale images
48 * Barcode reader for 1D barcodes (very early version as of 1.55)
49
50 ## Implementation characteristics ##
51
52 * _Efficient_: image data is packed binary (into 32-bit words); operations on 32-bit data whenever possible
53 * _Simple_: small number of data structures; simplest implementations provided that are efficient
54 * _Consistent_: data allocated on the heap with simple ownership rules; function names usually begin with primary data structure (e.g., _pix_); simple code patterns throughout
55 * _Robust_: all ptr args checked; extensive use of accessors; exit not permitted
56 * _Tested_: over 140 regression tests provided for basic functions and applications; valgrind tested
57 * _ANSI C_: automatically generated prototype header file
58 * _Portable_: endian-independent; builds in Linux, macOS, MinGW, Cygwin, Windows
59 * _Thread-safe_: uses atomic operations for reference counting
60 * _Documentation_: large number of in-line comments; doxygen; web pages for further background
61 * _Examples_: many programs provided to test and show usage of over 2700 functions in the library
62
63
64 ## Open Source Projects that use Leptonica ##
65 * [tesseract](https://github.com/tesseract-ocr/tesseract/) (optical character recognition)
66 * [OpenCV](https://github.com/opencv/opencv) (computer vision library)
67 * [jbig2enc](https://github.com/agl/jbig2enc) (encodes multipage binary image documents with jbig2 compression)
68
69 ## Major contributors to Leptonica ##
70 * Jeff Breidenbach: Jeff has built every Debian distribution for Leptonica. He has also made many improvements to formatted image I/O, including tiff, png and pdf. He is a continuous and practical advocate for simplification.
71 * David Bryan: David has worked for years to support Leptonica on multiple platforms. He designed many nice features in Leptonica, such as the severity-based error messaging system, and has identified and fixed countless bugs. And he has built and tested many distribution on cross-compilers.
72 * James Le Cuirot: James has written and supported the autotools scripts on Leptonica distributions for many years, and has helped test many recent distributions.
73 * Egor Pugin: Egor is co-maintainer of Leptonica on GitHub. He ported everything, including all the old distributions, from Google Code when it shut down. He set Leptonica up for appveyor and travis testing, and has implemented the sw project, which simplifies building executables on Windows.
74 * Stefan Weil: Stefan is a co-maintainer of Leptonica on GitHub. He has worked from the beginning to clean up the Leptonica GitHub distribution, including removing errors in the source code. Among other things: he suggested and implemented the use of Coverity Scan; made the library thread-safe by implementing atomic operations for reference counting; and helped remove internal struct data from the public interface.
75 * Zdenko Podobny: Zdenko is a co-maintainer of Leptonica on GitHub. He has worked, mostly behind the scenes as a primary maintainer of tesseract, to help with Leptonica builds on all platforms, and coordinate with its use in tesseract.
76 * Jürgen Buchmüller: Jürgen wrote text converters to modify Leptonica source code so that it generates documentation using doxygen. He also wrote tiff wrappers for memory I/O.
77 * Adam Korczynski: Adam is an expert in testing libraries for safety. He has built most of the open source fuzzers for Leptonica in the oss-fuzz project, with significant code coverage.
78 * Tom Powers: Tom supported the port of Leptonica to Windows for many years. He made many contributions to code quality and documentation.
79
80 ## Installing Leptonica (vcpkg)
81 * You can build and install Leptonica using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
82
83 ``` sh or powershell
84 git clone https://github.com/Microsoft/vcpkg.git
85 cd vcpkg
86 ./bootstrap-vcpkg.sh # "./bootstrap-vcpkg.bat" for powershell
87 ./vcpkg integrate install
88 ./vcpkg install leptonica
89 ```
90
91 * The Leptonica port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.