Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
39c0fc1
First image
RunDevelopment Oct 9, 2025
21fd4cf
Prepare for actual encoding and exact solid-color blocks
RunDevelopment Oct 9, 2025
bd45ece
WIP
RunDevelopment Oct 10, 2025
f9f1fc9
Merge branch 'main' into bc7
RunDevelopment Oct 15, 2025
b889190
Working BC7 encoding
RunDevelopment Oct 15, 2025
50e7bab
Generalize BC1 quantization
RunDevelopment Oct 16, 2025
ec20d26
proper mode 5 encoding
RunDevelopment Oct 16, 2025
b463442
Add channel swapping for mode5
RunDevelopment Oct 16, 2025
5364c46
Remove L metric for BC7
RunDevelopment Oct 16, 2025
62e2f24
Refactor rotation
RunDevelopment Oct 16, 2025
28fb75c
Minor optimization for channel swapping
RunDevelopment Oct 16, 2025
32d4759
Force opaque pixels
RunDevelopment Oct 16, 2025
0bf3b6a
Add mode 6
RunDevelopment Oct 16, 2025
8a6d997
Allow constant alpha for mode 6
RunDevelopment Oct 16, 2025
72e1866
Add mode 4
RunDevelopment Oct 16, 2025
a2ee568
Remove unused code
RunDevelopment Oct 16, 2025
db1029b
Add dumb mode 7
RunDevelopment Oct 19, 2025
f6eb298
Improved BCn subset logic
RunDevelopment Oct 19, 2025
466e811
Add mode 3
RunDevelopment Oct 19, 2025
25e8c82
Add mode 1
RunDevelopment Oct 19, 2025
952df80
Tried and failed to optimize partitions with k means clustering
RunDevelopment Oct 19, 2025
7974b31
Add mode 0 and mode 2
RunDevelopment Oct 19, 2025
5d0b098
Add ordered dithering for BC7
RunDevelopment Oct 19, 2025
259ee51
Update README
RunDevelopment Oct 19, 2025
112ecff
refactor mode 0-3 compression
RunDevelopment Oct 19, 2025
91a02fb
Fixed mode 0 partitions
RunDevelopment Oct 19, 2025
d7714bc
Improved RGBA compression
RunDevelopment Oct 19, 2025
28dd127
Slightly improved alpha p bit
RunDevelopment Oct 19, 2025
9ce0930
Removed unused function
RunDevelopment Oct 20, 2025
7d45ab2
move out subset3 partitioning
RunDevelopment Oct 20, 2025
b71b62f
Add quality modes
RunDevelopment Oct 20, 2025
aeb355b
Add dedicated error function for a 30% speed up
RunDevelopment Oct 21, 2025
baadc66
Removed unused code path
RunDevelopment Oct 21, 2025
edfa3d4
Only encode partitions that match a line well
RunDevelopment Oct 21, 2025
d9b897b
Cache partition scores between modes
RunDevelopment Oct 22, 2025
e965a2e
Faster quantization for Fast quality
RunDevelopment Oct 22, 2025
fede5d5
I forgot to measure alpha
RunDevelopment Oct 22, 2025
5f220bf
Changed how forced modes work
RunDevelopment Oct 22, 2025
df1c2fb
Include mode 4 for Fast to get better results
RunDevelopment Oct 22, 2025
bb75e3b
Allow warn
RunDevelopment Oct 22, 2025
e4f5344
Optimize RGBA 16 error function
RunDevelopment Oct 22, 2025
5a73dcd
Optimize mode 4 for constant channels
RunDevelopment Oct 22, 2025
fd362ef
Around 10% faster for Fast and Normal
RunDevelopment Oct 22, 2025
6428b8c
Light refactoring
RunDevelopment Oct 22, 2025
b824f68
Better config to make better use of partition cache
RunDevelopment Oct 22, 2025
f5495cf
Score by error
RunDevelopment Oct 22, 2025
ce64ba9
dist_sq for Rgb
RunDevelopment Oct 22, 2025
1249ed6
Faster Normal and High
RunDevelopment Oct 22, 2025
8888c70
code golfing
RunDevelopment Oct 22, 2025
77b8d92
Moved some code around
RunDevelopment Oct 23, 2025
a52ded5
Faster line distance
RunDevelopment Oct 23, 2025
e275d92
Cache partial errors for partition 3
RunDevelopment Oct 23, 2025
0abf6c1
Guess best p-bit configuration
RunDevelopment Oct 23, 2025
b0c72fa
Guess best color rotation
RunDevelopment Oct 23, 2025
10ca5f5
Remove unused methods
RunDevelopment Oct 23, 2025
9fdc8ee
Add static lifetime for older rust compilers
RunDevelopment Oct 23, 2025
a35a95e
Better docs
RunDevelopment Oct 23, 2025
0668dbb
Add support for limiting the number of partitions but don't use it fo…
RunDevelopment Oct 24, 2025
1801581
Fine tune refinement parameters
RunDevelopment Oct 24, 2025
ecdc5c9
Least squares optimize endpoints to produce higher quality faster
RunDevelopment Oct 24, 2025
d3b320e
Fix warning
RunDevelopment Oct 25, 2025
5c80d56
Extend BC7 benchmark
RunDevelopment Oct 25, 2025
a3d0fef
10% faster Fast encoding using a subset of mode 0
RunDevelopment Oct 25, 2025
b3dfe70
Improve quality for grayscale blocks
RunDevelopment Oct 31, 2025
d7f91b0
Slightly improve quality by removing clamping
RunDevelopment Oct 31, 2025
6a44f6d
Merge branch 'main' into bc7
RunDevelopment Nov 1, 2025
b923c45
Better nudging
RunDevelopment Nov 3, 2025
96b3637
Improve quality using a better partition heuristic
RunDevelopment Nov 6, 2025
8083c14
Merge branch 'main' into bc7
RunDevelopment Nov 6, 2025
a03ffc5
Improved alpha quantization for modes 4 and 5
RunDevelopment Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This library supports a total of over 70 formats for decoding, including:
- Over 30 uncompressed formats. E.g. `R8G8B8A8_UNORM`, `R9G9B9E5_SHAREDEXP`, `R32G32B32_FLOAT`.
- Many YUV formats. E.g. `AYUV`, `Y416`, `YUY2`, `NV12`.

Most formats support encoding. Notable exceptions are the ASTC formats ([#23](https://github.com/image-rs/image-dds/issues/23)), BC7 ([#20](https://github.com/image-rs/image-dds/issues/20)), and BC6 (currently not planned).
Most formats support encoding. Notable exceptions are the ASTC formats ([#23](https://github.com/image-rs/image-dds/issues/23)) and BC6 (currently not planned).

For a full list of all support formats and their capabilities, see [this document](./supported-formats.md).

Expand Down
9 changes: 8 additions & 1 deletion benches/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub fn encode_compressed(c: &mut Criterion) {
use Channels::*;

// images
let random: Image<f32> = Image::random(Size::new(128, 128), Rgba);
let random_rgba: Image<f32> = Image::random(Size::new(128, 128), Rgba);
let random_rgb: Image<f32> = Image::random(Size::new(128, 128), Rgb);
let random_tiny: Image<f32> = Image::random(Size::new(16, 16), Rgba);

Expand Down Expand Up @@ -208,6 +208,13 @@ pub fn encode_compressed(c: &mut Criterion) {
bench_encoder(c, Format::BC4_UNORM, high, &random_rgb);
bench_encoder(c, Format::BC4_UNORM, dither, &random_rgb);
// bench_encoder(c, Format::BC4_UNORM, unreasonable, &random_tiny);

bench_encoder(c, Format::BC7_UNORM, fast, &random_rgb);
bench_encoder(c, Format::BC7_UNORM, normal, &random_rgb);
bench_encoder(c, Format::BC7_UNORM, high, &random_rgb);
bench_encoder(c, Format::BC7_UNORM, fast, &random_rgba);
bench_encoder(c, Format::BC7_UNORM, normal, &random_rgba);
bench_encoder(c, Format::BC7_UNORM, high, &random_rgba);
}

pub fn encode_parallel(c: &mut Criterion) {
Expand Down
Loading
Loading