Skip to content

Fix map compositing edge case & loss of alpha channel data#28

Open
augenfrosch wants to merge 2 commits into
ackwell:mainfrom
augenfrosch:maps
Open

Fix map compositing edge case & loss of alpha channel data#28
augenfrosch wants to merge 2 commits into
ackwell:mainfrom
augenfrosch:maps

Conversation

@augenfrosch

Copy link
Copy Markdown

Fixes minor issues with the map asset endpoint, where the maps r2t2/00 & d2a8/00 were completely black by using a workaround & multiple small maps with transparent borders had black borders in the composited output by doing the compositing on the Rgba8 images and allowing output formats other than JPEG.

Sanity checking the performance, since one additional channel has to be composited with the current changes, using the tool I'm working on that uses boilmaster's asset endpoint code that extracts all maps in the Map sheet to disk, I get the following result:

# old
cargo run --release -- --input <...> maps --format jpg  83.87s user 5.73s system 98% cpu 1:31.04 total
# new
cargo run --release -- --input <...> maps --format png  71.06s user 7.02s system 97% cpu 1:19.80 total

I'm assuming the slight performance gain comes from the fact that the into_rgba8() call is faster since the DynamicImages are all a DynamicImage::ImageRgba8 variant and/or the existence check for the d texture not being necessary with the workaround.

Comment thread crates/bm_http/src/api1/asset.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants