A computer-implemented method for completing an image having at least one hole, the method comprising: - providing a dictionary of atoms representative of the known part of the image, an atom being a patch that is an element of a dictionary, a patch being a data structure of the same nature as the image but of smaller size, the dictionary of atoms being a dictionary-learnt set of atoms; - determining an optimal distribution of atom linear combinations with a process comprising at least one minimization (S22-S28) of a respective energy defined on a respective Markov Random Field having nodes and labels, each node corresponding to a respective location of the hole and being associated to a respective label, an atom linear combination being a patch that results from a linear combination of one or more atoms, the labels being different values the nodes can take, the determining implementing a top-down approach, the top-down approach being a method that comprises distinct Markov Random Field minimizations and that comprises combining the results of the distinct Markov Random Field minimizations to provide the optimal distribution of atom linear combinations, the at least one minimization of an energy including: o a first minimization, each label of the Markov Random Field respective to the first minimization taking its value within the dictionary of atoms; and then o a second minimization, each label of the Markov Random Field respective to the second minimization taking its value within a predetermined set of coefficients, said coefficients quantifying the mix between atoms in the atom linear combinations; the first minimization and the second minimization each providing a respective result representing a part of the optimal distribution of atom linear combinations, the respective results being combined to provide the optimal distribution of atom linear combinations; and - filling the hole with the optimal distribution. - providing a dictionary of atoms representative of the known part of the image, an atom being a patch that is an element of a dictionary, a patch being a data structure of the same nature as the image but of smaller size, the dictionary of atoms being a dictionary-learnt set of atoms; - determining an optimal distribution of atom linear combinations with a process comprising at least one minimization (S22-S28) of a respective energy defined on a respective Markov Random Field having nodes and labels, each node corresponding to a respective location of the hole and being associated to a respective label, an atom linear combination being a patch that results from a linear combination of one or more atoms, the labels being different values the nodes can take, the determining implementing a top-down approach, the top-down approach being a method that comprises distinct Markov Random Field minimizations and that comprises combining the results of the distinct Markov Random Field minimizations to provide the optimal distribution of atom linear combinations, the at least one minimization of an energy including: o a first minimization, each label of the Markov Random Field respective to the first minimization taking its value within the dictionary of atoms; and then o a second minimization, each label of the Markov Random Field respective to the second minimization taking its value within a predetermined set of coefficients, said coefficients quantifying the mix between atoms in the atom linear combinations; the first minimization and the second minimization each providing a respective result representing a part of the optimal distribution of atom linear combinations, the respective results being combined to provide the optimal distribution of atom linear combinations; and o a first minimization, each label of the Markov Random Field respective to the first minimization taking its value within the dictionary of atoms; and then o a second minimization, each label of the Markov Random Field respective to the second minimization taking its value within a predetermined set of coefficients, said coefficients quantifying the mix between atoms in the atom linear combinations; - filling the hole with the optimal distribution.