Skip to main content

Exposure

Build

With Exposure you can compute the exposure for a photo camera based on settings of the camera and metrics of the environment.

Installation

pip install exposure

Usage

>>> from exposure import Av, Tv, Sv, Bv, Iv, Exposure
>>> from decimal import Decimal
>>> from fractions import Fraction

Aperture

>>> Av.from_stop(1)
Av f/1.4

>>> Av.from_focal_length_and_diameter(10, 5)
Av f/2.0

>>> Av.from_fstop(Decimal("1.4"))
Av f/1.4

>>> Av.from_fstop(Decimal("22")).stop
Fraction(9, 1)

>>> Av.from_fstop(Decimal("22")).fstop
Decimal('22')

Speed

>>> Sv.from_iso(100)
Sv 100 ISO

>>> Sv.from_stop(Fraction(1, 1))
Sv 200 ISO

>>> Sv.from_iso(100).stop
Fraction(0, 1)

>>> Sv.from_iso(100).iso
100

Shutter

>>> Tv.from_stop(1)
Tv 2 sec

>>> Tv.from_time(Fraction(10, 13))
Tv 10/13 sec

>>> Tv.from_time(Fraction(2, 1)).stop
Fraction(1, 1)

>>> Tv.from_time(Fraction(2, 1)).time
Fraction(2, 1)

Brightness

>>> Bv.from_foot_lamberts(1)
Bv 3.4 cd/m2

>>> Bv.from_candelas(109)
Bv 109.2 cd/m2

>>> Bv.from_stop(3)
Bv 27.4 cd/m2

>>> Bv.from_stop(3).stop
Fraction(3, 1)

>>> Bv.from_stop(3).candelas
27.4

>>> Bv.from_stop(3).foot_lamberts
8

Incident Light

>>> Iv.from_foot_candles(25)
Iv 269.2 lux

>>> Iv.from_lux(1076)
Iv 1076.0 lux

>>> Iv.from_stop(3)
Iv 537.6 lux

>>> Iv.from_lux(1076).stop
Fraction(4, 1)

>>> Iv.from_lux(1076).lux
1076.0

>>> Iv.from_lux(1076).foot_candles
99.9

Exposure

>>> tv = Tv.from_stop(1)
>>> av = Av.from_stop(2)
>>> sv = Sv.from_stop(2)
>>> bv = Bv.from_stop(1)
>>> iv = Iv.from_stop(1)

The exposure is in balance when

>>> tv + av == sv + bv
True

or

>>> tv + av == sv + iv
True

This can also be used to compute a needed setting, like

>>> Tv.from_exposures(sv, bv, av)
Tv 2 sec
>>> Tv.from_exposures(sv, bv, av) == tv
True

>>> Av.from_exposures(sv, bv, tv)
Av f/2.0

>>> Sv.from_exposures(tv, bv, av)
Sv 400 ISO

>>> Sv.from_exposures(tv, iv, av)
Sv 400 ISO

Future work:

  • from_exif

Disclaimer

This package is based on http://dougkerr.net/Pumpkin/articles/APEX.pdf

Metadata

Release files for exposure 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exposure 0.1.1
File Size Uploaded Provenance Actions
exposure-0.1.1.tar.gz 5.0 kB Without provenance Details for exposure-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for exposure 0.1.1
File Interpreter ABI Platform Actions
exposure-0.1.1-py3-none-any.whl Python 3 none any Details for exposure-0.1.1-py3-none-any.whl

Total release size: 9.9 kB

Release files / exposure-0.1.1.tar.gz

Download URL exposure-0.1.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
15515429e683fdd1e4c0ff083c570f9cc2dfd15162242ef6dcc350ddc05d97e8
BLAKE2b-256 checksum
How to use checksums
2faa4747fbcb0a5e98e4140a0c7c95b8fbc6210785c56e561e733a9b891d1cc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.9.2 Linux/5.4.0-1040-azure

Release files / exposure-0.1.1-py3-none-any.whl

Download URL exposure-0.1.1-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78b4ab9894aa237b09e346a912214ef50309022113ff3f7c52be15ac9928622b
BLAKE2b-256 checksum
How to use checksums
a4c80ce5046e57afd0b3e65ab58ceb28da28510282eef058e82041379d6b4b8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.9.2 Linux/5.4.0-1040-azure

Security for exposure 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page