A method of encoding a video image includes, for each one of blocks of the video image, calculating virtual gradient values in the block depending on neighboring gradient values computed in a causal neighborhood of the block and acquiring one prediction direction or non-directional intra prediction mode based on the virtual gradient values; and determining a coding mode by comparing different predictions for the block , acquiring a predicted block by applying the determined "coding mode", acquiring a residual error between the predicted block and the current block and encoding a difference between the determined coding mode and the prediction direction or non-directional intra prediction mode. The calculating includes, for each prediction direction, propagating the neighboung gradient values along the prediction direction to estimate the virtual gradient values in the block.