Skip to main content

tool for compute with exposure settings and metrics for cameras

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exposure-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exposure-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file exposure-0.1.1.tar.gz.

File metadata

  • Download URL: exposure-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.4.0-1040-azure

File hashes

Hashes for exposure-0.1.1.tar.gz
Algorithm Hash digest
SHA256 15515429e683fdd1e4c0ff083c570f9cc2dfd15162242ef6dcc350ddc05d97e8
MD5 ec05885ef3ace35c79b6117fb6789b7c
BLAKE2b-256 2faa4747fbcb0a5e98e4140a0c7c95b8fbc6210785c56e561e733a9b891d1cc7

See more details on using hashes here.

File details

Details for the file exposure-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: exposure-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.4.0-1040-azure

File hashes

Hashes for exposure-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78b4ab9894aa237b09e346a912214ef50309022113ff3f7c52be15ac9928622b
MD5 23ccc2e2b3beccc09ae03e55e9992ac9
BLAKE2b-256 a4c80ce5046e57afd0b3e65ab58ceb28da28510282eef058e82041379d6b4b8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page