Provided are an image compression method and device. When coding a coding block, within a first, a second, and a third reconstructed reference pixel sample sets, the position labels whereof do not intersect, one or a plurality of optimal fixed-width, variable-length pixel sample matching strings are searched for and obtained, according to predetermined evaluation criteria. Each matching string is characterized by a matching relative position and a matching length. A pseudo matching sample is calculated from neighbouring samples for samples for which no match is found. A matching string search can be performed within a single pixel component plane or within a stacked format pixel space in which the three components are in a single crossed arrangement. Quantization or transformation-quantization coding, predictive coding, differential coding or entropy coding can then be performed on the matching relative position, the matching length and a matching residual error. The matching may have a variety of sample division modes and arrangement modes, an optimal one being selecting therefrom. Hybrid coding based on traditional prediction coding is performed simultaneously on a same coding unit, and an optimal coding mode is finally chosen.