Skip to content
Eskais UI

Forms

Sky Photo

Reads a photo of the sky locally: its EXIF (orientation, capture time and offset, GPS, compass heading, focal length and 35 mm equivalent) with a small parser of its own, its sky found by a classical skyline finder (colour, brightness and texture, a skyline per column by dynamic programming, holes and masts, a feathered mask) with no model to download, the photo's own clouds and window panes to light at night, and a rectilinear projection from a sun azimuth and altitude to the photo and back, with calibration from one marked point.

Example

Cebu City skyline
Captured
–
35 mm focal
– mm
Field of view
–
Sky found in
–

Sky tinted, default horizon as a line. Cebu City skyline by DisRaptor18, CC0, Wikimedia Commons.

Installation

npx shadcn@latest add @eskais/sky-photo

Usage

Import
import { analyzeSkyPhoto } from "@/lib/sky-photo"import { readSkyPhotoExif, readSkyPhotoExifFrom } from "@/lib/sky-photo-exif"import {  findSky,  findSkySteps,  finished,  rowsPerStep,  skyLikelihood,  skyMaskSize,} from "@/lib/sky-photo-mask"import {  calibrateSkyView,  defaultSkyPhotoFov,  fovFromFocalLength35mm,  projectSky,  unprojectSky,} from "@/lib/sky-photo-projection"import { findClouds, findCloudsSteps, findWindows, findWindowsSteps } from "@/lib/sky-photo-features"

Reach for it to put a rendered sky, a sun or weather into a photo of a real place. Everything runs on the device: nothing is uploaded and no model is downloaded. SunArc's photo mode is built on it.

API reference

This item exports functions and types rather than components.

Other exports

analyzeSkyPhotoreadSkyPhotoExifreadSkyPhotoExifFromfindSkyfindSkyStepsfinishedrowsPerStepskyLikelihoodskyMaskSizecalibrateSkyViewdefaultSkyPhotoFovfovFromFocalLength35mmprojectSkyunprojectSkyfindCloudsfindCloudsStepsfindWindowsfindWindowsStepstype SkyPhotoAnalysistype SkyPhotoOptionstype SkyPhotoExiftype Pixelstype Rgbtype SkyMasktype Stepstype SkyPhotoPointtype SkyPhotoViewtype SkyCloudstype SkyWindows

Accessibility

  • It draws nothing itself; a component that shows the photo gives it alt text or hides it as decoration.
  • The sky finder yields to the page between its stages, so reading a photo never blocks input for long.

Agent actions

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.