Excel learns to read pictures, thanks to Python

Image via Microsoft

Microsoft Excel is one of the most popular spreadsheet tools out there, especially among personal users and enterprise customers who are well-entrenched in Redmond"s ecosystem. We recently learned that Excel is getting a couple of new digital inking tools, and soon, it"s receiving an even more powerful capability that allows it to analyze images.

Microsoft is enabling customers to analyze images in Excel through the existing integration with the Python programming language. Users can simply insert an image into a single cell in the workbook and then write Python code in a separate cell using the PY() encapsulation. The cell with the image can be referenced with the xl() function, so if your inserted image is in the cell A1, you can simply refer to it with xl("A1").

In its blog post, Microsoft has demonstrated an example of detecting whether an image in Excel is blurry or sharp through a Laplacian filter. It has recommended using the Pillow library in Python as it contains multiple tools for opening images, processing them, analyzing their image data and metadata, applying filters and transformations, and more.

Since image analysis can be computationally expensive, performance is an important consideration in this implementation too. As such, Microsoft has added a new Default input size for images option under the File > Options > Advanced > When calculating this workbook > Python in Excel menu too. It enables users to choose between multiple resolutions including the default option of Actual size, Small (320x240), Medium (640x480), and Large (1280x960). If you exceed the per-cell data limit, Excel will throw an error that also shows guidance about how you can adjust this setting.

Image analysis in Excel with Python is available right now for Microsoft Insiders on the web, Windows (Version 2509, Build 19204.20002 or later), and Mac (Version 16.101, Build 25080524 or later). You can also provide feedback to the company directly through the Help > Feedback section in Excel.

Report a problem with article
Next Article

Deal alert: Ring Wired Doorbell Plus is now $50 off

Previous Article

Deal: Can you say no to this Intel 8-core Windows 11 laptop that's just $200?