What is the dimension of the filters if the input image has only one channel? I have a grayscale image with dimension HxWx1 (one channel). To build a CNN using the grayscale image as an input image, what is the dimension of the filters?

I read from some websites, it says that if the input image has only one channel, then the filter must be NxNx1. However, some other websites mentioned differently. It says even if the input image has one channel, it is fine to use filters with dimension NxNx3 by simply converting the grayscale image (HxWx1) to a RGB image (HxWx3).

Therefore, my question is: with input image that has only 1 channel, must the dimension of the filter be NxNx1 or NxNx3?

(I self-study this, so I might get the idea and understanding wrong. Help me, please.)

Note;
H: height, W: width, N: height and width of the filter
It is better, in most cases, to convert Grayscale images to RGB images with equal corresponding values in the 3 channels.

In this case, your filter size will be NxNx3.

The reason this approach is preferred is, among other things, if some time in future, you decide to use a pre-trained CNN you would most definitely need an RGB image to use its weights.