A comprehensive knowledge of the development and connectivity of fractures and vugs in carbonate reservoirs plays a key role in reservoir evaluation, ultimately affecting the gas prediction of this kind of heterogeneous reservoir. The carbonate reservoirs with fractures and vugs that are well developed in the Longwangmiao Formation, Sichuan Basin are selected as a research target, with the fractal dimension calculated from the full-bore formation microimager (FMI) image proposed to characterize the fractures and vugs. For this purpose, the multipoint statistics algorithm is first used to reconstruct a high-resolution FMI image of the full borehole wall. And then, the maximum class-variance method (the Otsu method) realizes the automatic threshold segmentation of the FMI image and acquisition of the binary image, which accurately characterizes the fractures and vugs. Finally, the fractal dimension is calculated by the box dimension algorithm, with its small value difference enlarged to obtain a new fractal parameter (). The fractal dimensions for four different kinds of reservoirs, including eight subdivided models of vugs and fractures, show that the fractal dimension can characterize the development and the connectivity of fractures and vugs comprehensively. That is, the more developed that the fractures and vugs are, the better the connectivity will be, and simultaneously the smaller that the values of the fractal dimensions are. The fractal dimension is first applied to the gas production prediction by means of constructing a new parameter () defined as a multiple of the effective thickness (), porosity (Por), and fractal dimension (). The field examples illustrate that the fractal dimensions can effectively characterize the fractures and vugs in the heterogeneous carbonate reservoir and predict its gas production. In summary, the fractals expand the characterization method for the vugs and fractures in carbonate reservoirs and extend its new application in gas production prediction.