In this paper we analyze the shape derivative of a cost functional appearing in image restoration. The main feature of this cost functional is the appearance of a variable exponent.