In order to better predictively
encode pixels of an image block of a video, a method of predicting a block of pixel colors of an image is proposed, comprising: determining a template-based
intra mode to derive a prediction applicable to the block; determining a plurality of intra prediction
modes, and determining respective costs for the plurality of intra prediction
modes; determining that a first TIMD mode is a first intra prediction mode of the plurality of intra prediction
modes having the lowest cost of the respective costs, and a second TIMD mode is a second intra prediction mode of the plurality of intra prediction modes having a penultimate cost of the respective costs; determining a third TIMD mode as a non-angular intra prediction mode; performing a
verification with respect to the third TIMD mode being different from the first TIMD mode and the third TIMD mode being different from the second TIMD mode; forming a final TIMD mode based on the
verification as true, the final TIMD mode comprising a linear combination of the first TIMD mode, the second TIMD mode, and the third TIMD mode; and forming a prediction of the block based on a template of the block and the final TIMD mode.