Image processing in Neptyne
Legacy spreadsheets support images but you can’t do much with them other than show them. In Neptyne images are first class citizens. If you’ve done image processing in Python you’ve probably used the Pillow library. Good news! All images in Neptyne are Pillow images and can be processed accordingly. Let’s start by putting an image in a sheet:
The Image method fetches an image from the provided url and puts that image directly into the sheet. The IMAGE_URL is defined in code since it is a rather long url pointing to wikipedia, see the code below.
Let’s write a quick function to adjust the the brightness of the image using Pillow
from PIL import ImageEnhance
So we import ImageEnhance and then call Brightness on an image for a certain level. Now that we’ve created this, we can call it straight from the spreadsheet to create a very simple image editor
We call “brighter” on the original image and B14, which contains the desired brightness level. Any time we change the value, the image in A15 changes brightness accordingly!
Try it out at: https://app.neptyne.com/-/ex90d0x6vn