RazrFalcon / tiny-skia

A tiny Skia subset ported to Rust
BSD 3-Clause "New" or "Revised" License
1.05k stars 67 forks source link

Any blur examples here? #116

Closed mistricky closed 3 months ago

mistricky commented 3 months ago

I like this project and the idea behind it, I have attempt to create a picture using tiny_skia, I want to know how to draw a effect like CSS box-shadow, is there have examples or projects I can refer?

RazrFalcon commented 3 months ago

tiny-skia is very low-level library. It doesn't have filters/effects support. It's basically a tool to draw bezier paths on a bitmap.

For a simple box-blur you can use: https://github.com/RazrFalcon/resvg/blob/master/crates/resvg/src/filter/box_blur.rs

mistricky commented 3 months ago

I see, thx for your reply, I'll refer this simple