An image decoding method performed by a decoding apparatus, the method comprising: obtaining image information including residual information, reference picture-related information and in-loop filtering information through a bitstream; deriving at least one reference picture, wherein the at least one reference picture is pointed to by the reference picture-related information, and the reference picture related information is an index pointing to the at least one reference picture; generating reconstructed samples of a current picture, based on the residual information and the at least one reference picture; determining whether an in-loop filtering process is performed for the reconstructed samples across virtual boundaries based on the in-loop filtering related information, wherein the in-loop filtering related information indicates whether the-in-loop filtering process is performed across the virtual boundaries; and generating modified reconstructed samples, based on the in-loop filtering process for the reconstructed samples, wherein the image information includes a sequence parameter set, SPS, and picture header information, wherein the image information comprises virtual boundaries-related information including information on a number of vertical virtual boundaries, information on positions of the vertical virtual boundaries, information on a number of horizontal virtual boundaries, and information on positions of the horizontal virtual boundaries, characterized in that based on whether reference picture resampling for the at least one reference picture is enabled, it is determined whether the SPS includes the virtual boundaries-related information, and wherein when the reference picture resampling for the at least one reference picture is enabled, the picture header information includes the virtual boundaries-related information and the SPS does not include the virtual boundaries-related information obtaining image information including residual information, reference picture-related information and in-loop filtering information through a bitstream; deriving at least one reference picture, wherein the at least one reference picture is pointed to by the reference picture-related information, and the reference picture related information is an index pointing to the at least one reference picture; generating reconstructed samples of a current picture, based on the residual information and the at least one reference picture; determining whether an in-loop filtering process is performed for the reconstructed samples across virtual boundaries based on the in-loop filtering related information, wherein the in-loop filtering related information indicates whether the-in-loop filtering process is performed across the virtual boundaries; and generating modified reconstructed samples, based on the in-loop filtering process for the reconstructed samples, wherein the image information includes a sequence parameter set, SPS, and picture header information, wherein the image information comprises virtual boundaries-related information including information on a number of vertical virtual boundaries, information on positions of the vertical virtual boundaries, information on a number of horizontal virtual boundaries, and information on positions of the horizontal virtual boundaries, characterized in that based on whether reference picture resampling for the at least one reference picture is enabled, it is determined whether the SPS includes the virtual boundaries-related information, and wherein when the reference picture resampling for the at least one reference picture is enabled, the picture header information includes the virtual boundaries-related information and the SPS does not include the virtual boundaries-related information