shmuelzon / home-assistant-floor-plan

Home Assistant Floor Plan Generator Plugin For Sweet Home 3D
MIT License
331 stars 8 forks source link

Optimize non RGB image size #88

Open Swiiney opened 1 month ago

Swiiney commented 1 month ago

When you render floorplan, RGB lights are rendered as images with maximum of transparency. This means images are small when considering file size. When you render non RGB lights the full 3D is in the image. This means all those lights are using an image the same file size as the base one which could be big.

All those big images implies bigger page to load which could be longer (even if after the first time the images are in cache)

Could it be possible to create smaller images by making transparent part that are not impacted by th light (as for RGB) ?

Before using your plugin (by the way thank you ;-)) I created my floorplan by hands following some tutorials and I removed all non impacted part. It worked perfectly.

Thanks

shmuelzon commented 1 month ago

Hey, this is, basically, what the room overlay rendering mode does. It works fine but has its drawbacks. The two main ones are that the interactions between lights doesn't look as good and the second is that the method with which I currently decide which pixels to set as transparent creates rough edges and adds noise to the image (you'll see random dark pixels in the transparent sections)