-
-
SAAYA uses applied mathematics to help photographers analyze and recreate professional lighting setups.
-
Demonstrates how light intensity changes with distance using simplified mathematical lighting models.
-
Users identify highlights and shadows in reference photos to help estimate lighting configurations.
-
Vector geometry, trigonometry, and numerical optimization help calculate plausible lighting positions.
-
Visualizes how changes in lighting angles and elevation affect illumination and shadows.
-
Converts calculated lighting parameters into settings photographers can test during real photoshoots.
Inspiration
Photography has always been something I've enjoyed, and it's been a big part of my life throughout high school. I took photography classes throughout high school, and I was always the person taking pictures at my school's sports games, capturing moments at my friends' parties, and making recap videos for my own family events. Over time, I became more interested in not just taking pictures, but understanding what makes a photograph visually appealing, especially how lighting, shadows, and different angles can completely change the way an image looks.
I've also always been drawn to fashion photography and editorial shoots, where lighting plays such an important role in creating a certain mood or aesthetic. As an Applied and Computational Mathematics student, I started thinking about how I could combine my interest in photography with the mathematical concepts I've been learning.
One thing I noticed is that recreating the lighting from a professional photograph can be difficult. Photographers often have to experiment with different light positions, angles, and intensities to achieve a particular look. I started wondering whether mathematics could make this process more efficient and accessible, especially for people who don't have access to professional studios or expensive equipment.
That idea eventually became SAAYA, a name inspired by the Hindi and Urdu word for shadow.
What it does
SAAYA is a web-based computational photography tool that helps photographers analyze lighting in reference images and explore how to recreate similar lighting setups. Users can upload a reference photograph and identify areas of light and shadow. SAAYA then uses vector geometry, trigonometry, simplified Lambertian lighting models, the inverse-square law, and numerical optimization to estimate plausible lighting configurations based on those observations.
Vector geometry and trigonometry help represent the direction and angle of incoming light. A simplified Lambertian model describes how illumination changes with the angle at which light strikes a surface, while the inverse-square law approximates how illumination decreases as the light source moves farther away. Numerical optimization is then used to search for lighting parameters that best match the selected reference characteristics under the model's assumptions.
The application allows users to adjust parameters such as light direction, elevation, distance, and source size while visualizing how these changes affect the simulated lighting. Users can also export their settings to use as a starting point during an actual photoshoot.
Rather than editing a photograph after it's been taken, SAAYA focuses on helping photographers understand and plan their lighting before taking the shot.
How we built it
I developed SAAYA using Python for the mathematical calculations and Streamlit to build the interactive web application. I started by breaking down the problem of recreating photographic lighting into a set of mathematical variables, including light direction, elevation, distance, and source size. These became the parameters users could adjust and explore through the interface.
One of the first components I worked on was representing light direction mathematically. I used vector geometry and trigonometry to describe lighting angles in three-dimensional space. By converting horizontal and vertical angles into directional vectors, I could build a model that estimates how light interacts with a simulated surface. This allowed me to connect the physical positioning of a light source to a mathematical representation of illumination.
I then incorporated a simplified lighting model that relates surface brightness to the direction of incoming light and the distance between the light and the surface. This draws on concepts from Lambertian reflection, where illumination depends on the angle between the incoming light and a surface's normal vector, along with distance-based light falloff. These approximations helped create a foundation for visualizing how changes in light placement can affect the appearance of shadows and highlights.
Another important part of the project was numerical optimization. Since a single reference photograph cannot reveal the exact lighting arrangement used to create it, I approached the problem as an inverse estimation task. I developed an optimization process that searches for plausible lighting parameters based on the characteristics selected from the uploaded photograph. Rather than returning an exact reconstruction, the model provides an estimated setup that photographers can use as a starting point.
After developing the mathematical components, I connected them to Streamlit to make the application interactive. Users can upload reference photographs, identify highlights and shadows, adjust lighting parameters through sliders, and view simulations of the resulting illumination. I also added an option to export the lighting settings so users can experiment with the suggested configurations during their own photoshoots.
Finally, I tested the mathematical functions and deployed SAAYA through Streamlit Community Cloud, allowing anyone to access the application through a browser without downloading software.
Throughout the development process, I focused on making the mathematical models useful and understandable. I wanted users to interact with the calculations visually rather than needing to understand every equation behind them.
Challenges we ran into
One of the biggest challenges was figuring out how to translate the lighting characteristics of a two-dimensional photograph into mathematical parameters representing a three-dimensional lighting setup.
A photograph doesn't provide enough information to determine the exact position of the original light sources. Different combinations of lighting, camera settings, and surface materials can produce similar visual results.
To account for this, I worked with a simplified mathematical model that estimates plausible lighting configurations instead of assuming there is only one correct solution.
Another challenge was making the mathematical calculations understandable to users who might not have a technical background. I wanted SAAYA to be useful to photographers while still preserving the mathematical reasoning behind its recommendations.
Accomplishments that we're proud of
One of the accomplishments I'm most proud of is being able to turn two of my interests, applied mathematics and photography, into a fully functioning web application. Before building SAAYA, I had never really considered how mathematical concepts like vector geometry, trigonometry, and numerical optimization could be used to solve creative challenges in photography.
I'm especially proud of developing a mathematical lighting model that translates visual observations into adjustable lighting parameters. Being able to take concepts that are usually taught through equations and turn them into an interactive tool that photographers can actually experiment with was one of the most rewarding parts of this project.
Another accomplishment was making SAAYA publicly accessible through Streamlit Community Cloud. What started as an idea became a working application that anyone can access and use without needing to understand the mathematics behind it.
Overall, I'm proud that I challenged myself to apply mathematics outside of a traditional classroom setting and created something that connects technical problem-solving with artistic expression. SAAYA showed me that mathematics can be just as creative as the fields it helps shape.
What we learned
Building SAAYA helped me understand how applied mathematics can be used in creative fields that I hadn't previously associated with mathematical modeling.
I gained experience connecting vector geometry, trigonometry, and numerical optimization to computational photography. I also learned more about developing interactive applications and translating mathematical calculations into visual tools that people can experiment with.
One of my biggest takeaways was that mathematical models don't necessarily need to produce a perfect answer to be useful. Even an approximate model can help users understand a problem and make more informed decisions, as long as its assumptions and limitations are clear.
What's next for SAAYA - Every Shadow Has an Equation
I want to continue developing SAAYA into a more advanced lighting assistant for photographers.
One feature I'd like to introduce is automatic highlight and shadow detection, which would reduce the need for manual annotations. I also want to build an interactive studio lighting diagram that visually shows where photographers could position their equipment.
Another area I'm interested in exploring is how different fabric materials reflect light. Since SAAYA is designed with fashion photography in mind, incorporating material-specific lighting models could make its recommendations more useful for photographing clothing with different textures and reflective properties. Eventually, I'd like to test SAAYA through real photoshoots and compare its mathematical predictions with actual lighting results. My goal is to continue exploring how applied mathematics can make creative tools more accessible and practical.