@logomarks/core 0.1.2 → 0.1.3
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/similar/signature.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to `@logomarks/core` are documented here.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.3] — 2026-11-06
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `letterSignatures()` counts a pixel as ink only above half coverage (8-bit alpha 128 and up, as `holecheck.mjs` did): with Float32 coverage, an alpha of 127 rounded past `127 / 255` and counted, which moved letter scores by about a hundredth and could reorder near matches.
|
|
13
|
+
|
|
8
14
|
## [0.1.2] — 2026-11-06
|
|
9
15
|
|
|
10
16
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logomarks/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Geometry, SVG reading, fitting, analysis and similarity for logomarks on a 512 grid: the kit the Logomarks set is drawn with (shapes, real booleans, strokes, tracks, iso solids, badges, letter skeletons), one SVG path parser, the 448 fit, speck and shape-tag analysis, outline signatures, and the industry-symbol parts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
package/src/similar/signature.js
CHANGED
|
@@ -96,7 +96,8 @@ function cropped(a, R, N) {
|
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
98
|
* A mark's letter signatures from its coverage at LETTER.render: its holes (null when it has none) and its ink, each
|
|
99
|
-
* cropped to its box at LETTER.size.
|
|
99
|
+
* cropped to its box at LETTER.size. A pixel is ink when it is more than half covered (8-bit alpha 128 and up, as
|
|
100
|
+
* holecheck read it), whether the coverage is a Float32Array or a Float64Array.
|
|
100
101
|
*
|
|
101
102
|
* @param {Float32Array} alpha Coverage 0–1, `render` × `render`.
|
|
102
103
|
* @param {number} [R] Its side (128).
|
|
@@ -105,7 +106,8 @@ function cropped(a, R, N) {
|
|
|
105
106
|
*/
|
|
106
107
|
export function letterSignatures(alpha, R = LETTER.render, N = LETTER.size) {
|
|
107
108
|
const ink = new Uint8Array(R * R);
|
|
108
|
-
|
|
109
|
+
// > 0.5, not > 127 / 255: an alpha of 127 stored as Float32 rounds up past the double 127 / 255 and would count as ink
|
|
110
|
+
for (let i = 0; i < ink.length; i++) ink[i] = alpha[i] > 0.5 ? 1 : 0;
|
|
109
111
|
const holes = cropped(holesOf(ink, R), R, N);
|
|
110
112
|
return { holes: holes.some((v) => v > 0) ? holes : null, ink: cropped(ink, R, N) };
|
|
111
113
|
}
|