scanic 1.0.5 โ†’ 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  Scanic is a high-performance document scanner library that brings professional-grade document edge detection and perspective correction to the browser and Node.js. By combining **Rust-powered WebAssembly** for pixel crunching and **GPU-accelerated Canvas** for image warping, Scanic delivers near-native performance (~10ms transforms) with a tiny footprint.
19
19
 
20
- [**Live Demo**](https://marquaye.github.io/scanic/demo.html) | [**Framework Examples**](#๐Ÿ’ป-framework-examples) | [**API Reference**](#โš™๏ธ-api-reference)
20
+ [**Live Demo**](https://marquaye.github.io/scanic) | [**Framework Examples**](#๐Ÿ’ป-framework-examples) | [**API Reference**](#โš™๏ธ-api-reference)
21
21
 
22
22
  ---
23
23
 
@@ -43,6 +43,13 @@ Traditional web scanning solutions often force a trade-off:
43
43
  - ๐Ÿ“ฆ **Featherweight**: Under **100KB** total size (gzipped).
44
44
  - ๐Ÿงช **Production Grade**: Built-in regression tests with physical image baselines.
45
45
 
46
+ ## ๐Ÿ†• What's New (v1.0.7)
47
+
48
+ - Improved default document quality with adaptive multi-pass candidate evaluation.
49
+ - More stable corners on noisy contours through multi-epsilon approximation and duplicate-vertex cleanup.
50
+ - Expanded debug tooling with full test image coverage and corner delta comparison against jscanify.
51
+ - Expanded live demo sample set for broader real-world validation.
52
+
46
53
  ---
47
54
 
48
55
  ## ๐Ÿ› ๏ธ Installation
@@ -65,7 +72,7 @@ yarn add scanic
65
72
  ## ๐ŸŽฎ Demo
66
73
 
67
74
  Try the interactive scanner in your browser:
68
- ๐Ÿ‘‰ [**Open Scanic Live Demo**](https://marquaye.github.io/scanic/demo.html)
75
+ ๐Ÿ‘‰ [**Open Scanic Live Demo**](https://marquaye.github.io/scanic)
69
76
 
70
77
  ---
71
78
 
@@ -163,9 +170,18 @@ The primary function for detecting and extracting documents.
163
170
  | `mode` | `'detect' \| 'extract'` | `'detect'` | `'detect'` returns coordinates; `'extract'` returns the warped image. |
164
171
  | `output` | `'canvas' \| 'imagedata' \| 'dataurl'` | `'canvas'` | The format of the returned processed image. |
165
172
  | `maxProcessingDimension` | `number` | `800` | Downscales image to this size for detection (faster). |
166
- | `lowThreshold` | `number` | `75` | Lower threshold for Canny edge detection. |
167
- | `highThreshold` | `number` | `200` | Upper threshold for Canny edge detection. |
173
+ | `lowThreshold` | `number` | `adaptive` | Optional lower threshold for Canny edge detection. If omitted together with `highThreshold`, adaptive thresholds are used. |
174
+ | `highThreshold` | `number` | `adaptive` | Optional upper threshold for Canny edge detection. |
175
+ | `applyDilation` | `boolean` | `true` | Enables dilation in the primary pass. |
176
+ | `dilationKernelSize` | `number` | `3` | Morphological dilation kernel size for edge connection. |
177
+ | `dilationIterations` | `number` | `1` | Number of dilation passes. |
168
178
  | `minArea` | `number` | `1000` | Minimum pixel area to consider a contour a "document". |
179
+ | `enableDetectionCascade` | `boolean` | `true` | Enables fallback pass profiles for hard images. |
180
+ | `minCascadeTriggerConfidence` | `number` | `0.68` | Confidence threshold before trying additional pass profiles. |
181
+ | `maxCandidateContours` | `number` | `12` | Number of largest contours to score per pass. |
182
+ | `minDocumentCoverageRatio` | `number` | `0.04` | Minimum image coverage required for a valid candidate. |
183
+ | `minDocumentFillRatio` | `number` | `0.07` | Minimum contour fill ratio within its bounding box. |
184
+ | `maxDocumentAspectRatio` | `number` | `8` | Maximum accepted aspect ratio for candidates. |
169
185
  | `debug` | `boolean` | `false` | If true, returns intermediate processing steps. |
170
186
 
171
187
  #### Return Value
@@ -312,7 +328,7 @@ const result = await scanDocument(img, { mode: 'extract' });
312
328
 
313
329
  | Feature | Scanic | jscanify | OpenCV.js |
314
330
  | :--- | :--- | :--- | :--- |
315
- | **Download Size** | **~100KB** | ~1MB | ~30MB |
331
+ | **Download Size** | **~100KB** | ~31MB | ~30MB |
316
332
  | **Perspective Speed** | **~10ms** | ~200ms | ~5ms |
317
333
  | **WASM Optimized** | โœ… Yes | โŒ No | โœ… Yes |
318
334
  | **GPU Acceleration** | โœ… Yes | โŒ No | โŒ No |
@@ -388,6 +404,14 @@ Contributions are welcome! Whether it's reporting a bug, suggesting a feature, o
388
404
  <br/>
389
405
  <em>Language and translation services</em>
390
406
  </td>
407
+ <td align="center" width="250">
408
+ <a href="https://mein-kreativbuch.de/" target="_blank">
409
+ <br/>
410
+ <strong>mein-kreativbuch.de</strong>
411
+ </a>
412
+ <br/>
413
+ <em>Unique and personalized children's books</em>
414
+ </td>
391
415
  </tr>
392
416
  </table>
393
417