Expression painter:grestore() restores the painter settings previously saved by a matching expression painter:gsave().

Functions painter:gsave and painter:restore should be used to bracket code segments that perform some rendering in order to ensure that the painter settings remain unchanged.