Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur alpha #107

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Blur alpha #107

wants to merge 5 commits into from

Conversation

ErikReider
Copy link
Member

@ErikReider ErikReider commented Feb 18, 2025

Adds support for blur alpha.

2025-02-22.00-48-16.mp4

Tested with SwayFX main branch using:

for_window [app_id="kitty" title="opacity test"] floating enable; resize set 800 400
exec kitty -T "opacity test" -o "background_opacity 0.0" -e $SHELL -c './opacity_script.sh; read'

script to run in nested kitty:

set_opacity() {
    opacity=$(perl -e "print ((100 - $i) / 100)")
    swaymsg "[app_id=\"kitty\" title=\"opacity test\"] opacity $opacity"
    echo "Opacity: $opacity"
    sleep 0.1
}

while true; do
    for ((i = 0; i < 100; i++)); do
        set_opacity "$i"
    done
    for ((i = 100; i >= 0; i--)); do
        set_opacity "$i"
    done
done

Tested in SwayFX:

  • Floating toplevels (non-optimized blur)
  • Tiled toplevels and “x-ray” floating toplevels (optimized blur)
  • Scene rect color alpha adjusts blur alpha

@ErikReider ErikReider added the enhancement New feature or request label Feb 18, 2025
@ErikReider ErikReider self-assigned this Feb 18, 2025
@ErikReider
Copy link
Member Author

Updated the desc with a video of the implementation. There are some minor artifacts in the top right section of the window blur, where there are thin lines. This is due to the lowering of the num_passes and doubling of the blur radius (which displays more artifacts).

Not sure if there's anything that can be done here, except maybe mixing a max opacity blur with the lower opacity blur? Or maybe mixing the higher num_passes version with the lower one?

@ErikReider ErikReider marked this pull request as ready for review February 21, 2025 21:45
@WillPower3309
Copy link
Member

Updated the desc with a video of the implementation. There are some minor artifacts in the top right section of the window blur, where there are thin lines. This is due to the lowering of the num_passes and doubling of the blur radius (which displays more artifacts).

Not sure if there's anything that can be done here, except maybe mixing a max opacity blur with the lower opacity blur? Or maybe mixing the higher num_passes version with the lower one?

Is this still present? I didn't notice it from the video

@ErikReider
Copy link
Member Author

Updated the desc with a video of the implementation. There are some minor artifacts in the top right section of the window blur, where there are thin lines. This is due to the lowering of the num_passes and doubling of the blur radius (which displays more artifacts).
Not sure if there's anything that can be done here, except maybe mixing a max opacity blur with the lower opacity blur? Or maybe mixing the higher num_passes version with the lower one?

Is this still present? I didn't notice it from the video

Not anymore! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants