A method for encoding a digital image into a video bitstream, wherein the digital image is one of a sequence of digital images forming video data, wherein said method comprises: generating a palette having one or more palette entries associated to pixel values; determining one or more values of indexes of a current block used for encoding one of a plurality of coding units of said digital image using said palette according to a palette coding mode, wherein each of the values of said indexes corresponds to a palette entry of said palette; encoding said indexes of the current block according to a raster scan order of encoding using flags to be signalled in the bitstream, one or more of said flags indicating whether the value of a given index of the current block is (i) signalled in said bitstream or (ii) to be determined by copying the value of an index of a row above in said raster scan order of the current block, wherein the value of the given index of the current block is signalled after said flag in said bitstream, and encoding said digital image into said video bitstream using the determined value of the current index, characterised in that, in a case where, according to the raster scan order of encoding: a current index of the current block is to be encoded following a previous index of the current block, and (i) a flag to be associated with the current index in the current block indicates that the value of the current index is signalled in said bitstream, and (ii) a flag to be associated with the previous index indicates that the value of the previous index is to be determined by copying the value of an index of a row above the previous index in said raster scan order of the current block, wherein the value of the given index of the current block is signalled after said flag in said bitstream; the value of the current index is determined by excluding the value of an index located above the current index in the current block from the one or more values of indexes for the current block. generating a palette having one or more palette entries associated to pixel values; determining one or more values of indexes of a current block used for encoding one of a plurality of coding units of said digital image using said palette according to a palette coding mode, wherein each of the values of said indexes corresponds to a palette entry of said palette; encoding said indexes of the current block according to a raster scan order of encoding using flags to be signalled in the bitstream, one or more of said flags indicating whether the value of a given index of the current block is (i) signalled in said bitstream or (ii) to be determined by copying the value of an index of a row above in said raster scan order of the current block, wherein the value of the given index of the current block is signalled after said flag in said bitstream, and encoding said digital image into said video bitstream using the determined value of the current index, characterised in that, in a case where, according to the raster scan order of encoding: a current index of the current block is to be encoded following a previous index of the current block, and (i) a flag to be associated with the current index in the current block indicates that the value of the current index is signalled in said bitstream, and (ii) a flag to be associated with the previous index indicates that the value of the previous index is to be determined by copying the value of an index of a row above the previous index in said raster scan order of the current block, wherein the value of the given index of the current block is signalled after said flag in said bitstream; (i) a flag to be associated with the current index in the current block indicates that the value of the current index is signalled in said bitstream, and (ii) a flag to be associated with the previous index indicates that the value of the previous index is to be determined by copying the value of an index of a row above the previous index in said raster scan order of the current block, wherein the value of the given index of the current block is signalled after said flag in said bitstream; the value of the current index is determined by excluding the value of an index located above the current index in the current block from the one or more values of indexes for the current block.