How to display image based on cell value

Is it posible to display certain image depending on the value of a certain cell?

Of course, it is possible

Lights.ods

Very good, Thanks. Do you also have a sample loading the image from an eternal file?

How to set macro see here

For current LibreOffice, all usages of .GraphicURL should be replaced with .Graphic (not sure how to clear images in case of invalid selection).

Yes, @mcanedo, I have it - LoadPicture.ods

(Some other solutions - i.e. Python - here)