What is filter size and image size are same?

For example, if we have to apply 3X3 filter to 3X3 image and I want an output of 3X3. Then will I need a padding of 2?

That seems mathematically correct.