fluttercommunity / flutter_blurhash

Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium. Maintainer: @Solido
https://pub.dev/packages/flutter_blurhash
MIT License
519 stars 65 forks source link

BlurHash shadow #6

Open aytunch opened 4 years ago

aytunch commented 4 years ago

Let's say we use a Stack and place the BlurHash image on bottom and the actual image on top(BlurHash image being a little bigger than the actual image). I haven't tried but just by imagining, this might end up with a cool shadow effect instead of the normal fixed color shadows. Of course in this case we would need to gradually decrease the opacity of the blurhas image for it to look like a real shadow.

DagAgren commented 4 years ago

I've really wanted to try this. You could possibly extend the edge colour outwards, or just scale up the blur image a bit, and apply a gaussian blur as a mask.

You'd probably want to either darken the blurhash, or combine it with a second black shadow. This way you would emulate the effects of indirect reflections when shadowing.