simple way to invert logic
A SOT23-5 Schmitt Trigger inverter like SN74LVC1G14DBVR might be smaller than some self made circuit.

However, if you need two of them, a multi port inverter will certainly be easier/smaller.

See also the comment of dim below.