The process was not gradual. There were only two astronomers between Ptolemy and Copernicus who independently estimated planetary distances, and it is uncertain if Copernicus was aware of their results, although there are indications that he was of al-Shāṭir's. Some of al-Shāṭir's estimates
can be found in Planetary Theory of Ibn al-Shāṭir by Kennedy and Roberts, and there is a consensus that some of his planetary models are largely identical to Copernicus's (except for minor variations in parameters, and heliocentric reversal of the last vector in epicyclic linkages), see e.g. Saliba's Greek Astronomy and the Medieval Arabic Tradition. So Ibn al-Shāṭir (1304-1375) may be the unsung hero of the Copernican revolution.
However, some historians argue that Copernicus might have come to his estimates and models independently by working from the same Ptolemaic base, with its observartional problems, and sharing the methodological aspirations of Islamic astronomers to eliminate eccentrics and equants, see di Bono's Copernicus, Amico, Fracastro and Tusi's Device. Copernicus's method of estimating mean distances based on planetary parallaxes was explained to Kepler by his teacher Maestlin. It is nicely presented in the appendix he wrote, reproduced in Grafton's paper, to his pupil's Mysterium Cosmographicum, where Kepler tried to derive said distances from dimensions of nested Platonic solids.
In Ptolemaic models only the epicycle/deferent ratio matters for planetary positions, if both sizes are say simultaneously doubled the observed trajectory on the celestial sphere remains exactly the same. Ptolemy deliberately avoids the discussion of mean distance ratios for different planets in the Almagest, but in Planetary Hypotheses he notes:
"The distances of the five planets are not as easy to determine as those of the two luminaries, for the distances of the two luminaries were determined, mostly, on the basis of combinations of eclipses. A similar proof cannot be invoked for the five planets, because no phenomenon allows us to fix their parallax with certainty."
According to Goldstein's Theory and Observation in Medieval Astronomy, Ptolemy turns to the broader theory to do the task, the "nesting hypothesis" of Aristotelian cosmology: the maximum distance to each planet (mean plus epicycle radius) is set equal to the minimum distance (mean minus epicycle radius) to the next one. Even Ptolemy's solar and lunar distances (estimated according to Aristarchus's methodology) were far off, e.g. the Moon should have appeared twice as large at quadrature than at opposition, and for Venus say the size variation would have been nearly sevenfold, making it look two fifths the size of the Sun at its largest.
Ptolemy says nothing about these discrepancies. Silence is golden, and Ptolemy's silence doubly so. Most medieval astronomers followed his lead on it, with two exceptions. One was Jewish Talmudist and polymath Gersonides (Levi ben Gerson, 1288–1344), who pointed out Ptolemy's visible size absurdities, and used a pinhole camera to measure variations in sizes of the Moon and the planets. He discovered no correlations between them and epicyclic periods, and introduced a fluid layer between the neighboring spheres to account for his own estimates of the distances that violated the nesting hypothesis, see Gerson’s Theory of Planetary Distances by Goldstein.
The other was the aforementioned late representative of the Maragha school of Islamic astronomers Ibn al-Shāṭir, who, according to Goldstein, "wished to find a new model that agreed with them as closely as possible - that is, he accepted Ptolemy's lunar positions in longitude and latitude and merely wished to repair the distance". Unlike Gersonides, al-Shāṭir's models were better than Ptolemy's even for longitudes, they also eliminated Ptolemy's Aristotelian transgressions of eccentrics and equants by replacing them with epicyclic linkages, a culmination of Maragha school's efforts. Neugebauer and Swerdlow argued that Maraghian astronomy was known in Italy in early 1500s, when Copernicus studied there. Neugebauer even found a Greek translation of an Arabic manuscript describing the Tusi couple, a Maraghian device Copernicus employs in both Commentariolus and De Revolutionibus. But the manuscript does not mention al-Shāṭir, and so far as we know Copernicus did not read Arabic (although some of his Italian contacts might have).