The easiest part is to paint the background and create the rectangle.
We can create another rectangle whose width would cover the bottom two points of the lamp head.
You can create a slanted rectangle using transform: rotate() and an inverse slanted rectangle on the other side to create the slanted version of the lamp head.
I can still see little borders on the diff image but doesn’t matter when our mission is complete.