Beneath a Goya masterpiece, a second, hidden painting by the Spanish painter has been discovered, the Rijksmuseum in Amsterdam has announced.

New technology has brought the image to light for the first time since Goya painted over it, apparently for political reasons.

Curators were aware of something beneath the surface of Goya's powerful 1823 portrait of Don Ramon Satue, a judge in the supreme court in Madrid, but it was so faint they could not decipher details, let alone the composition.

Seen in great detail

High-intensity X-ray technology developed by Joris Dik of Delft University and Koen Janssens of Antwerp University means the painting can be seen for the first time in great detail.

Napoleon's brother

It is thought to be of a French general or even Joseph Bonaparte, who was briefly king of Spain and brother of Napoleon. Everything from the brushwork to the precise medals worn on the sitter's uniform can be seen.

Dik told the Guardian the technology allowed his team “to visualise” a Goya painting that had not been seen before: “It is exciting.”

Scanning macro X-ray fluorescence spectrometry technology — in which fluorescent X-rays map the picture's pigments to create a colour image of it — was first tried out two years ago on a Van Gogh painting.

It revealed his previously unknown portrait of a peasant woman, which the artist painted over with the 1887 work Patch of Grass.

This time, however, the technology has been developed further in a mobile version that can be used in museums on paintings that are too delicate to be moved.

The potential for uncovering unknown works of art is enormous as so many artists reused canvases, usually to save money or to conceal an earlier work with which they were dissatisfied.

Bonaparte's order

Dik said the medals worn by the sitter can be identified as linked to an order created by Joseph Bonaparte, Napoleon's brother, during his short reign as king of Spain, from 1808 to 1813.

The portrait probably dates from between 1809 and 1813. However, having a painting associated with Bonaparte after the Napoleonic forces had withdrawn from Spain would not have gone down well.

Goya, the survivor

Dik said: “Goya, we know, managed to survive both political situations — the transfer of Spain to the French and back to Spain. After 1820, [such a portrait] could have been dangerous.

That's when we believe the portrait was overpainted with the figure we can see now, as that painting dates from 1823.”

It was during the Napoleonic wars that Francisco de Goya (1746—1828) created masterpieces such as his Disasters of War etchings. In these paintings were his responses to the occupying French army's atrocities. — © Guardian Newspapers Limited, 2011