Visting the National Gallery of Art here in DC yesterday, we were struck by how many of the religious-themed paintings from the 15th and 16th centuries featured books with readable text. Take Piero di Cosimo's 1489/1490 "The Visitation with Saint Nicholas and Saint Anthony Abbot" in which Saint Nicholas reads from an illuminated breviary with fully legible text. But what does the text say? We quickly checked the museum's own website, but it makes no mention of the text, while a Google search for "The Visitation with Saint Nicholas and Saint Anthony Abbot book text" similarly turns up nothing. Stumped, we asked Gemini 3.8 Flash to tell us what the text says, trying both using Gemini's built-in reasoning and, assuming that Gemini would need help rotating and cropping the text, we also gave it access to code writing so it could write its own Python code to help it read the text. The end result is striking: stock Gemini translated and transcribed the text perfectly, even offering additional context, while code-writing Gemini got stuck in an infinite loop of image manipulation before running out of time. For all the excitement about code writing AI, for image analysis, current models don't actually need the help of external code and do better when allowed to reason directly. Finally, Gemini even tracked down doctoral dissertation from 2011 (that never came up in our Google searches) that dives into the deeper meaning of why this specific text was excerpted in this specific way and painted the way it was, completing our understanding of the painting.
Once again, the power of AI to help museum patrons better engage with and understand the works they see – in this case answering a question that neither the museum website nor a basic web search was able to answer! Finally, it is worth noting that the low resolution image on the museum's website is too poor quality to enable the analysis below, which was only possible by taking high-resolution photographs with a cellphone onsite, offering a reminder that in an era of high resolution screens and AI assistants, museums should release higher resolution imagery of their works to enable greater engagement with them.
You can see the full sequence of photos below, but it was the third image (zoomed in sufficiently to make the text readable) that we provided to Gemini, along with the simple prompt:
Transcribe and translate the text in the book he is reading.
We tried two versions of Gemini. Assuming that Gemini would need to write Python code to zoom, crop, rotate and enhance the book text to get a better look at it for transcription, we initially used Gemini 3.8 Flash With Code Execution. It burned through nearly 50,000 tokens entering an infinite loop of cropping, rotating and trying again. Click on the image below to see the full sequence:
The second time, we used the same prompt, but used Gemini 3.8 Flash with Code Execution disabled. This time Gemini transcribed the passage in seconds and recommended that we consult this 2011 doctoral dissertation for a deeper dive into the meaning of the text in this context:
The text is an excerpt from the biblical Book of Wisdom (Wisdom of Solomon 1:1, 1:4–6), with verses 2 and 3 omitted:
Left Page: [D] ligite iustitiam qui iudicatis terram sentite de domino in bonitate et in sim- plicitate cordis querite illum quonia[m] in maliuolam animam non introibit sapie[n]- tia nec habitabit in corpore subdito
Right Page: p[ec]c[at]is. s[piritus] sapie[ntiae]… o spiritus emim s[an]ctus discipli- ne effugiet fictu[m] et auferet se a co- gitationibus que sine intellectu et corripietur a (in red) super uenie[n]te iniquitate benign[us…]
And translated as:
"Love justice, you who judge the earth. Think of the Lord in goodness, and seek Him in simplicity of heart. For wisdom will not enter into a malicious soul, nor dwell in a body subject to sins. For the holy spirit of discipline will flee deceit, and will withdraw itself from thoughts that are without understanding, and will be rebuked when iniquity comes upon it. For kindly [is the spirit of wisdom…]"
You can see the photos of the painting below:
This is the zoomed image that we provided to Gemini for its analysis:
Finally, we manually cropped and rotated the image above to showcase the book text so you can compare with the Gemini-produced transcription above. NOTE that this image was NOT provided to Gemini, it is provided below for reference only – Gemini transcribed the original upside-down image above: