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
513 stars 65 forks source link

Array of input blurhashes #29

Closed salihagic closed 3 years ago

salihagic commented 3 years ago

Would it make sense to create a way for the user of flutter_blurhash to be able to provide an array of incrementaly bigger blurhashes so they would render in that order to make an ilusion of loading a clean image.

example: AspectRatio( aspectRatio: 1.6, child: BlurHash( hashes: ["L5H2EC=PM+yV0g-mq.wG9c010J}I", "L5H2EC=PM+yV0g-mq.wG9c010J}IL5H2EC=PM+yV0g-mq.wG9c010J}I", "L5H2EC=PM+yV0g-mq.wG9c010J}IL5H2EC=PM+yV0g-mq.wG9c010J}IL5H2EC=PM+yV0g-mq.wG9c010J}IL5H2EC=PM+yV0g-mq.wG9c010J}I",] ), ),

Solido commented 3 years ago

I get your point but in real case the transition from the first hash to the real image will render much better than having to wait for the network to send new hashes.

The other case is you send a precalculated array but it has to be very large to matches the smooth transition effect so it mean a lot of preprocessing power and it defeat the low bandwith benefits of blurhash

I close for now but if your work on the idea and get some results please reopen the discussion @salihagic