Skip to content

Commit 532e338

Browse files
committed
v5.3.0
- (Add) Layer compression level setting: Allow to set different compression levels for compressors (Default: Optimal) - (Add) `UVtoolsCmd benchmark-layer-codecs` command: Benchmarks all available layer codecs and return the metrics - (Improvement) Optimize the layer previewer by caching some objects and use pattern rendering for background grid - (Improvement) Optimize the layer compressors to use less allocations (memory) and more performant (Tune your value under settings) - (Change) Default layer compression codec from `PNG` to `Brotli` - (Change) Layer previewer scrollbars are now shown as full bar instead of minimal style when not hovered - (Upgrade) .NET from 9.0.9 to 10.0.1 - (Upgrade) AvaloniaUI from 11.3.6 to 11.3.10 - (Upgrade) OpenCV from 4.11.0 to 4.12.0
1 parent beda0ac commit 532e338

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3317
-3042
lines changed

.github/workflows/package-publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,31 @@ jobs:
3131
# - name: Download WingetCreate.exe
3232
# run: iwr -Uri https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
3333
# - name: Set VERSION variable from tag
34-
# run: |
34+
# run: |
3535
# $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
3636
# $version = $github.release.tag_name.Trim('v')
3737
# if($version.Length -lt 5)
38-
# {
38+
# {
3939
# Write-Error "Version $version is too short!"
40-
# exit -1
40+
# exit -1
4141
# }
4242
# Write-Output "Version: ${version}"
4343
# "VERSION=${version}" >> $env:GITHUB_ENV
4444
# - name: Set INSTALLER_URL variable from release asset
45-
# run: |
45+
# run: |
4646
# $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
4747
# $installerUrl = $github.release.assets | Where-Object -Property name -match "${env:WINGET_PACKAGE_NAME}" | Select -ExpandProperty browser_download_url -First 1
4848
# if($null -eq $installerUrl)
49-
# {
49+
# {
5050
# Write-Error "Installer URL not found on ${github.release.assets}"
51-
# exit -1
51+
# exit -1
5252
# }
5353
# Write-Output "Installer url: ${installerUrl}"
5454
# "INSTALLER_URL=${installerUrl}" >> $env:GITHUB_ENV
5555
# - name: Submit package to Windows Package Manager Community Repository
5656
# run: .\wingetcreate.exe update ${env:WINGET_PACKAGE_ID} --version ${env:VERSION} --urls ${env:INSTALLER_URL} --token ${env:WINGET_TOKEN} --submit
5757

58-
58+
5959
#homebrew:
6060
# name: 🚀 Homebrew Cask - Pull request
6161
# runs-on: macos-latest
@@ -78,18 +78,18 @@ jobs:
7878
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
7979
git branch --remote --contains | grep origin/master
8080
81-
- name: 🟣 Setup .NET 9.0
81+
- name: 🟣 Setup .NET 10.0
8282
uses: actions/setup-dotnet@v3
8383
with:
84-
dotnet-version: 9.0.x
84+
dotnet-version: 10.0.x
8585

8686
#- name: Set VERSION variable from tag
87-
# run: |
87+
# run: |
8888
# TAG=${{ github.event.release.tag_name }}
8989
# echo "VERSION=${TAG#v}" >> $GITHUB_ENV
9090

9191
- name: 📦 Pack
92-
run: |
92+
run: |
9393
dotnet pack UVtools.Core --configuration Release --output .
9494
dotnet pack UVtools.AvaloniaControls --configuration Release --output .
9595

CHANGELOG.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,121 @@
11
# Changelog
22

3+
## /12/2025 - v5.3.0
4+
- (Add) Layer compression level setting: Allow to set different compression levels for compressors (Default: Optimal)
5+
- (Add) `UVtoolsCmd benchmark-layer-codecs` command: Benchmarks all available layer codecs and return the metrics
6+
- (Improvement) Optimize the layer previewer by caching some objects and use pattern rendering for background grid
7+
- (Improvement) Optimize the layer compressors to use less allocations (memory) and more performant (Tune your value under settings)
8+
- (Change) Default layer compression codec from `PNG` to `Brotli`
9+
- (Change) Layer previewer scrollbars are now shown as full bar instead of minimal style when not hovered
10+
- (Upgrade) .NET from 9.0.9 to 10.0.1
11+
- (Upgrade) AvaloniaUI from 11.3.6 to 11.3.10
12+
- (Upgrade) OpenCV from 4.11.0 to 4.12.0
13+
14+
### Benchmark Results (Compression codecs):
15+
```
16+
Layer count: 4079
17+
Resolution: 15120 x 6230
18+
Pixels: 94197600
19+
Uncompressed size/layer: 89.83 MB
20+
Total uncompressed size: 357.84 GB
21+
22+
*** Total benchmark time: 00:17:50.3077230 ***
23+
24+
*** Results: ***
25+
Png @ Lowest | Size: 2.21 GB | Ratio: 162.06x | Saved: 99.38% | Time: 00:01:04.3998609 | Speed: 5689.95 MB/s | Efficiency: 0.25
26+
Png @ Optimal | Size: 2.16 GB | Ratio: 165.75x | Saved: 99.40% | Time: 00:01:05.0797156 | Speed: 5630.51 MB/s | Efficiency: 0.25
27+
Png @ Highest | Size: 1.12 GB | Ratio: 318.37x | Saved: 99.69% | Time: 00:03:18.4133623 | Speed: 1846.81 MB/s | Efficiency: 0.16
28+
GZip @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.2616015 | Speed: 15752.66 MB/s | Efficiency: 0.50
29+
GZip @ Optimal | Size: 1.05 GB | Ratio: 342.42x | Saved: 99.71% | Time: 00:00:25.6639611 | Speed: 14278.08 MB/s | Efficiency: 1.33
30+
GZip @ Highest | Size: 939.70 MB | Ratio: 389.94x | Saved: 99.74% | Time: 00:01:30.0616082 | Speed: 4068.68 MB/s | Efficiency: 0.43
31+
Deflate @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.0203633 | Speed: 15917.74 MB/s | Efficiency: 0.51
32+
Deflate @ Optimal | Size: 1.04 GB | Ratio: 342.44x | Saved: 99.71% | Time: 00:00:25.5197428 | Speed: 14358.77 MB/s | Efficiency: 1.34
33+
Deflate @ Highest | Size: 939.63 MB | Ratio: 389.97x | Saved: 99.74% | Time: 00:01:28.1487339 | Speed: 4156.98 MB/s | Efficiency: 0.44
34+
Brotli @ Lowest | Size: 1.99 GB | Ratio: 180.26x | Saved: 99.45% | Time: 00:00:42.0633973 | Speed: 8711.43 MB/s | Efficiency: 0.43
35+
Brotli @ Optimal | Size: 900.21 MB | Ratio: 407.05x | Saved: 99.75% | Time: 00:00:29.6359804 | Speed: 12364.44 MB/s | Efficiency: 1.37
36+
Lz4 @ Lowest | Size: 2.36 GB | Ratio: 151.49x | Saved: 99.34% | Time: 00:00:22.5018498 | Speed: 16284.54 MB/s | Efficiency: 0.67
37+
Lz4 @ Optimal | Size: 1.63 GB | Ratio: 219.44x | Saved: 99.54% | Time: 00:00:40.9114073 | Speed: 8956.72 MB/s | Efficiency: 0.54
38+
Lz4 @ Highest | Size: 1.57 GB | Ratio: 228.14x | Saved: 99.56% | Time: 00:05:31.6114879 | Speed: 1105.00 MB/s | Efficiency: 0.07
39+
40+
*** Sorted by best compression ratio: ***
41+
Brotli @ Optimal | Size: 900.21 MB | Ratio: 407.05x | Saved: 99.75% | Time: 00:00:29.6359804 | Speed: 12364.44 MB/s | Efficiency: 1.37
42+
Deflate @ Highest | Size: 939.63 MB | Ratio: 389.97x | Saved: 99.74% | Time: 00:01:28.1487339 | Speed: 4156.98 MB/s | Efficiency: 0.44
43+
GZip @ Highest | Size: 939.70 MB | Ratio: 389.94x | Saved: 99.74% | Time: 00:01:30.0616082 | Speed: 4068.68 MB/s | Efficiency: 0.43
44+
Deflate @ Optimal | Size: 1.04 GB | Ratio: 342.44x | Saved: 99.71% | Time: 00:00:25.5197428 | Speed: 14358.77 MB/s | Efficiency: 1.34
45+
GZip @ Optimal | Size: 1.05 GB | Ratio: 342.42x | Saved: 99.71% | Time: 00:00:25.6639611 | Speed: 14278.08 MB/s | Efficiency: 1.33
46+
Png @ Highest | Size: 1.12 GB | Ratio: 318.37x | Saved: 99.69% | Time: 00:03:18.4133623 | Speed: 1846.81 MB/s | Efficiency: 0.16
47+
Lz4 @ Highest | Size: 1.57 GB | Ratio: 228.14x | Saved: 99.56% | Time: 00:05:31.6114879 | Speed: 1105.00 MB/s | Efficiency: 0.07
48+
Lz4 @ Optimal | Size: 1.63 GB | Ratio: 219.44x | Saved: 99.54% | Time: 00:00:40.9114073 | Speed: 8956.72 MB/s | Efficiency: 0.54
49+
Brotli @ Lowest | Size: 1.99 GB | Ratio: 180.26x | Saved: 99.45% | Time: 00:00:42.0633973 | Speed: 8711.43 MB/s | Efficiency: 0.43
50+
Png @ Optimal | Size: 2.16 GB | Ratio: 165.75x | Saved: 99.40% | Time: 00:01:05.0797156 | Speed: 5630.51 MB/s | Efficiency: 0.25
51+
Png @ Lowest | Size: 2.21 GB | Ratio: 162.06x | Saved: 99.38% | Time: 00:01:04.3998609 | Speed: 5689.95 MB/s | Efficiency: 0.25
52+
Lz4 @ Lowest | Size: 2.36 GB | Ratio: 151.49x | Saved: 99.34% | Time: 00:00:22.5018498 | Speed: 16284.54 MB/s | Efficiency: 0.67
53+
Deflate @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.0203633 | Speed: 15917.74 MB/s | Efficiency: 0.51
54+
GZip @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.2616015 | Speed: 15752.66 MB/s | Efficiency: 0.50
55+
56+
*** Sorted by fastest time: ***
57+
Lz4 @ Lowest | Size: 2.36 GB | Ratio: 151.49x | Saved: 99.34% | Time: 00:00:22.5018498 | Speed: 16284.54 MB/s | Efficiency: 0.67
58+
Deflate @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.0203633 | Speed: 15917.74 MB/s | Efficiency: 0.51
59+
GZip @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.2616015 | Speed: 15752.66 MB/s | Efficiency: 0.50
60+
Deflate @ Optimal | Size: 1.04 GB | Ratio: 342.44x | Saved: 99.71% | Time: 00:00:25.5197428 | Speed: 14358.77 MB/s | Efficiency: 1.34
61+
GZip @ Optimal | Size: 1.05 GB | Ratio: 342.42x | Saved: 99.71% | Time: 00:00:25.6639611 | Speed: 14278.08 MB/s | Efficiency: 1.33
62+
Brotli @ Optimal | Size: 900.21 MB | Ratio: 407.05x | Saved: 99.75% | Time: 00:00:29.6359804 | Speed: 12364.44 MB/s | Efficiency: 1.37
63+
Lz4 @ Optimal | Size: 1.63 GB | Ratio: 219.44x | Saved: 99.54% | Time: 00:00:40.9114073 | Speed: 8956.72 MB/s | Efficiency: 0.54
64+
Brotli @ Lowest | Size: 1.99 GB | Ratio: 180.26x | Saved: 99.45% | Time: 00:00:42.0633973 | Speed: 8711.43 MB/s | Efficiency: 0.43
65+
Png @ Lowest | Size: 2.21 GB | Ratio: 162.06x | Saved: 99.38% | Time: 00:01:04.3998609 | Speed: 5689.95 MB/s | Efficiency: 0.25
66+
Png @ Optimal | Size: 2.16 GB | Ratio: 165.75x | Saved: 99.40% | Time: 00:01:05.0797156 | Speed: 5630.51 MB/s | Efficiency: 0.25
67+
Deflate @ Highest | Size: 939.63 MB | Ratio: 389.97x | Saved: 99.74% | Time: 00:01:28.1487339 | Speed: 4156.98 MB/s | Efficiency: 0.44
68+
GZip @ Highest | Size: 939.70 MB | Ratio: 389.94x | Saved: 99.74% | Time: 00:01:30.0616082 | Speed: 4068.68 MB/s | Efficiency: 0.43
69+
Png @ Highest | Size: 1.12 GB | Ratio: 318.37x | Saved: 99.69% | Time: 00:03:18.4133623 | Speed: 1846.81 MB/s | Efficiency: 0.16
70+
Lz4 @ Highest | Size: 1.57 GB | Ratio: 228.14x | Saved: 99.56% | Time: 00:05:31.6114879 | Speed: 1105.00 MB/s | Efficiency: 0.07
71+
72+
*** Sorted by best efficiency score (balanced time/compression): ***
73+
Brotli @ Optimal | Size: 900.21 MB | Ratio: 407.05x | Saved: 99.75% | Time: 00:00:29.6359804 | Speed: 12364.44 MB/s | Efficiency: 1.37
74+
Deflate @ Optimal | Size: 1.04 GB | Ratio: 342.44x | Saved: 99.71% | Time: 00:00:25.5197428 | Speed: 14358.77 MB/s | Efficiency: 1.34
75+
GZip @ Optimal | Size: 1.05 GB | Ratio: 342.42x | Saved: 99.71% | Time: 00:00:25.6639611 | Speed: 14278.08 MB/s | Efficiency: 1.33
76+
Lz4 @ Lowest | Size: 2.36 GB | Ratio: 151.49x | Saved: 99.34% | Time: 00:00:22.5018498 | Speed: 16284.54 MB/s | Efficiency: 0.67
77+
Lz4 @ Optimal | Size: 1.63 GB | Ratio: 219.44x | Saved: 99.54% | Time: 00:00:40.9114073 | Speed: 8956.72 MB/s | Efficiency: 0.54
78+
Deflate @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.0203633 | Speed: 15917.74 MB/s | Efficiency: 0.51
79+
GZip @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.2616015 | Speed: 15752.66 MB/s | Efficiency: 0.50
80+
Deflate @ Highest | Size: 939.63 MB | Ratio: 389.97x | Saved: 99.74% | Time: 00:01:28.1487339 | Speed: 4156.98 MB/s | Efficiency: 0.44
81+
GZip @ Highest | Size: 939.70 MB | Ratio: 389.94x | Saved: 99.74% | Time: 00:01:30.0616082 | Speed: 4068.68 MB/s | Efficiency: 0.43
82+
Brotli @ Lowest | Size: 1.99 GB | Ratio: 180.26x | Saved: 99.45% | Time: 00:00:42.0633973 | Speed: 8711.43 MB/s | Efficiency: 0.43
83+
Png @ Optimal | Size: 2.16 GB | Ratio: 165.75x | Saved: 99.40% | Time: 00:01:05.0797156 | Speed: 5630.51 MB/s | Efficiency: 0.25
84+
Png @ Lowest | Size: 2.21 GB | Ratio: 162.06x | Saved: 99.38% | Time: 00:01:04.3998609 | Speed: 5689.95 MB/s | Efficiency: 0.25
85+
Png @ Highest | Size: 1.12 GB | Ratio: 318.37x | Saved: 99.69% | Time: 00:03:18.4133623 | Speed: 1846.81 MB/s | Efficiency: 0.16
86+
Lz4 @ Highest | Size: 1.57 GB | Ratio: 228.14x | Saved: 99.56% | Time: 00:05:31.6114879 | Speed: 1105.00 MB/s | Efficiency: 0.07
87+
88+
*** Sorted by weighted efficiency (favors compression): ***
89+
Brotli @ Optimal | Size: 900.21 MB | Ratio: 407.05x | Saved: 99.75% | Time: 00:00:29.6359804 | Speed: 12364.44 MB/s | Efficiency: 1.37
90+
Deflate @ Optimal | Size: 1.04 GB | Ratio: 342.44x | Saved: 99.71% | Time: 00:00:25.5197428 | Speed: 14358.77 MB/s | Efficiency: 1.34
91+
GZip @ Optimal | Size: 1.05 GB | Ratio: 342.42x | Saved: 99.71% | Time: 00:00:25.6639611 | Speed: 14278.08 MB/s | Efficiency: 1.33
92+
Deflate @ Highest | Size: 939.63 MB | Ratio: 389.97x | Saved: 99.74% | Time: 00:01:28.1487339 | Speed: 4156.98 MB/s | Efficiency: 0.44
93+
GZip @ Highest | Size: 939.70 MB | Ratio: 389.94x | Saved: 99.74% | Time: 00:01:30.0616082 | Speed: 4068.68 MB/s | Efficiency: 0.43
94+
Lz4 @ Lowest | Size: 2.36 GB | Ratio: 151.49x | Saved: 99.34% | Time: 00:00:22.5018498 | Speed: 16284.54 MB/s | Efficiency: 0.67
95+
Lz4 @ Optimal | Size: 1.63 GB | Ratio: 219.44x | Saved: 99.54% | Time: 00:00:40.9114073 | Speed: 8956.72 MB/s | Efficiency: 0.54
96+
Brotli @ Lowest | Size: 1.99 GB | Ratio: 180.26x | Saved: 99.45% | Time: 00:00:42.0633973 | Speed: 8711.43 MB/s | Efficiency: 0.43
97+
Deflate @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.0203633 | Speed: 15917.74 MB/s | Efficiency: 0.51
98+
GZip @ Lowest | Size: 3.06 GB | Ratio: 117.13x | Saved: 99.15% | Time: 00:00:23.2616015 | Speed: 15752.66 MB/s | Efficiency: 0.50
99+
Png @ Optimal | Size: 2.16 GB | Ratio: 165.75x | Saved: 99.40% | Time: 00:01:05.0797156 | Speed: 5630.51 MB/s | Efficiency: 0.25
100+
Png @ Lowest | Size: 2.21 GB | Ratio: 162.06x | Saved: 99.38% | Time: 00:01:04.3998609 | Speed: 5689.95 MB/s | Efficiency: 0.25
101+
Png @ Highest | Size: 1.12 GB | Ratio: 318.37x | Saved: 99.69% | Time: 00:03:18.4133623 | Speed: 1846.81 MB/s | Efficiency: 0.16
102+
Lz4 @ Highest | Size: 1.57 GB | Ratio: 228.14x | Saved: 99.56% | Time: 00:05:31.6114879 | Speed: 1105.00 MB/s | Efficiency: 0.07
103+
104+
*** RECOMMENDED CHOICES: ***
105+
Best balanced (speed + compression): Brotli @ Optimal
106+
- Compression: 900.21 MB, 407.05x (99.75% saved)
107+
- Speed: 12364.44 MB/s
108+
- Efficiency: 1.37
109+
Best for speed: LZ4 @ Lowest (Use with high RAM)
110+
- Compression: 2.36 GB, 151.49x (99.34% saved)
111+
- Speed: 16284.54 MB/s
112+
- Efficiency: 0.67
113+
Best for maximum compression: Brotli @ Optimal
114+
- Compression: 900.21 MB, 407.05x (99.75% saved)
115+
- Speed: 12364.44 MB/s
116+
- Efficiency: 1.37
117+
```
118+
3119
## 26/09/2025 - v5.2.1
4120
- (Add) PrusaSlicer printer: Elegoo Mars 5 (#1063)
5121
- (Fix) PCB Exposure Tool: Incorrect oval apertures (#1066)

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<!-- Project -->
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Platforms>AnyCPU;x64;ARM64</Platforms>
66
<Nullable>enable</Nullable>
77

@@ -38,8 +38,8 @@
3838
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
3939

4040
<!-- Versions -->
41-
<UVtoolsVersion>5.2.1</UVtoolsVersion>
42-
<AvaloniaVersion>11.3.6</AvaloniaVersion>
41+
<UVtoolsVersion>5.3.0</UVtoolsVersion>
42+
<AvaloniaVersion>11.3.10</AvaloniaVersion>
4343

4444
<!-- MvvmToolkit -->
4545
<MvvmToolkitEnableINotifyPropertyChangingSupport>false</MvvmToolkitEnableINotifyPropertyChangingSupport>

Scripts/UVtools.ScriptSample/ScriptInsetSample.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void ScriptInit()
6767
public string? ScriptValidate()
6868
{
6969
StringBuilder sb = new();
70-
70+
7171
if (InsetMarginFromEdge.Value < InsetMarginFromEdge.Minimum)
7272
{
7373
sb.AppendLine($"Inset edge margin must be at least {InsetMarginFromEdge.Minimum}{InsetMarginFromEdge.Unit}");
@@ -76,7 +76,7 @@ public void ScriptInit()
7676
{
7777
sb.AppendLine($"Inset thickness must be at least {InsetThickness.Minimum}{InsetThickness.Unit}");
7878
}
79-
79+
8080
return sb.ToString();
8181
}
8282

@@ -87,10 +87,10 @@ public void ScriptInit()
8787
public bool ScriptExecute()
8888
{
8989
var kernel =
90-
CvInvoke.GetStructuringElement(ElementShape.Rectangle, new Size(3, 3), EmguExtensions.AnchorCenter); // Rectangle 3x3 kernel
90+
CvInvoke.GetStructuringElement(MorphShapes.Rectangle, new Size(3, 3), EmguExtensions.AnchorCenter); // Rectangle 3x3 kernel
9191
Progress.Reset("Inset layers", Operation.LayerRangeCount); // Sets the progress name and number of items to process
9292

93-
93+
9494
// Loop user selected layers in parallel, this will put each core of CPU working here on parallel
9595
Parallel.For(Operation.LayerIndexStart, Operation.LayerIndexEnd+1, CoreSettings.GetParallelOptions(Progress), layerIndex =>
9696
{

0 commit comments

Comments
 (0)