kivy-garden / frostedglass

FrostedGlass is a widget with translucent frosted glass effect, that creates a context with the background behind it.
MIT License
42 stars 6 forks source link

[BUG]: Ensure accurate rendering of Horizontal and Vertical Blur #15

Open T-Dynamos opened 1 year ago

T-Dynamos commented 1 year ago

Minimal Code:

import sys
from kivy.lang import Builder
from kivy.app import App
from kivy.clock import Clock
from kivy_garden.frostedglass import FrostedGlass

IMAGE = sys.argv[1]

KV = """
RelativeLayout:
    Image:
        id:bg
        source:app.image
        fit_mode:"cover"
        anim_delay:0.05 
    FrostedGlass:
        id:glass
        pos_hint: {'center_x': 0.5, 'center_y': 0.5}
        size_hint: 0.5, 0.5
        background:bg
        blur_size: 10
        saturation: 1.0
        luminosity: 1.2
        noise_opacity: 0.05
        border_radius:  [dp(20)] * 4
        overlay_color:1,1,1,0.2
        outline_color: 1,1,1,0.2
        outline_width: dp(0.8)
"""

class Main(App):

    image = IMAGE

    def build(self):
        return Builder.load_string(KV)

Main().run()

RUN WITH python3 test.py <image file>

When running code with this gif or this image results: Screenshot_20230528_203746 Expected Output:

Frame 1

(Made using figma)

But when using a normal image results: Screenshot_20230528_204158

DexerBR commented 1 year ago

Note: This issue occurs when there is a predominance of pixels of the same color (or very close tones) aligned vertically and/or horizontally in the FrostedGlass background.