@thi.ng/pixel-analysis 1.0.0 → 1.0.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-07-24T19:45:06Z
3
+ - **Last updated**: 2025-07-24T21:23:41Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -11,6 +11,15 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ### [1.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/pixel-analysis@1.0.1) (2025-07-24)
15
+
16
+ #### 🩹 Bug fixes
17
+
18
+ - bail out if insufficient samples ([41ba4c3](https://github.com/thi-ng/umbrella/commit/41ba4c3))
19
+ - update `temperature()` to return empty result if insufficient color samples
20
+ - update hue standard deviation ([9b0ea02](https://github.com/thi-ng/umbrella/commit/9b0ea02))
21
+ - return normalized hue SD (not in radians)
22
+
14
23
  # [1.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pixel-analysis@1.0.0) (2025-07-24)
15
24
 
16
25
  #### 🛑 Breaking changes
package/analyze-colors.js CHANGED
@@ -82,7 +82,7 @@ const derivedColorsResult = (colors, minSat) => {
82
82
  luma: vmean(dominantLuma)
83
83
  },
84
84
  sd: {
85
- hue: circularSD(hues),
85
+ hue: circularSD(hues) / TAU,
86
86
  sat: sd(sats),
87
87
  luma: sd(dominantLuma)
88
88
  },
package/hues.js CHANGED
@@ -77,6 +77,9 @@ const temperature = (colors, minSat = 0.2) => {
77
77
  return num >= 1 ? repeat(hue * TAU, num) : null;
78
78
  }, hues)
79
79
  ];
80
+ if (!angles.length) {
81
+ return { hues, meanHue: 0, temp: 0, areaTemp: 0, area: 0 };
82
+ }
80
83
  const meanHue = circularMean(angles) / TAU;
81
84
  const temp = hueTemperature(meanHue);
82
85
  const areaTemp = temp * area;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/pixel-analysis",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Image color & feature analysis utilities",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -112,5 +112,5 @@
112
112
  "status": "beta",
113
113
  "year": 2024
114
114
  },
115
- "gitHead": "c5c6b895169788c7f8b3d6d61ff76c0c6e5d2c2a\n"
115
+ "gitHead": "98bec7f990466d4771d8580362d4bdd58ffeea63\n"
116
116
  }