Skip to main content

XCamera: Android-optimized camera widget

Github Actions Tests Github Actions Android Build Status Coverage Status PyPI version

XCamera is a widget which extends the standard Kivy Camera widget with more functionality. In particular:

  1. it displays a "shoot button", which the user can press to take pictures

  2. on Android, it uses the native APIs to take high-quality pictures, including features such as auto-focus, high resolution, etc.

  3. it includes a method to force landscape mode. On Android, it is often desirable to switch to landscape mode when taking pictures: you can easily do it by calling camera.force_landscape(), and later camera.resource_orientation() to restore the orientation to whatever it was before.

Screenshot:

screenshot

Notes:

  • On Android, the resolution property of the XCamera (and also of the plain Camera) widget controls the preview size: in other words, it only affects the quality of the preview, not the size of the pictures taken.

  • As it is now, the camera will shoot using the default setting for the picture size, which seems to be what the camera think it is "the best". In theory, we could add a method to retrieve the list of all possible picture sizes, and add a property to control it. It would also be nice to add a new button to allow the user to manually select the preferred size. Pull requests are welcome :)

Install & Usage

xcamera is available on PyPI. Therefore it can be installed via pip.

pip3 install xcamera

Once installed, the demo should be available in your PATH and can be ran from the command line.

xcamera

And the widget can be imported via:

from kivy_garden.xcamera import XCamera

Demo

A full working demo is available in src/kivy_garden/xcamera/main.py. You can run it via:

make run

Develop & Contribute

To play with the project, install system dependencies and Python requirements using the Makefile.

make

Then verify everything is OK by running tests.

make test

If you're familiar with Docker, the project can also run in a fully isolated container. First build the image.

make docker/build

Then you can run tests within the container.

make docker/run/test

Or the application itself.

make docker/run/app

Release files for xcamera 2020.613

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

Source distribution (sdist)

Source distribution for xcamera 2020.613
File Size Uploaded
xcamera-2020.613.tar.gz 45.7 kB Details

Built distribution (wheel)

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

Total release size: 90.9 kB

Release files / xcamera-2020.613.tar.gz

Download URL xcamera-2020.613.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e960d32d19da23efc8e96002b60e6c293a459867e0f1d0bda1eb9a13b69bf4e7
BLAKE2b-256 checksum
How to use checksums
e603032f7dcfb156a1591f5006012367a05280ee50079833e440527f30f8169f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release files / xcamera-2020.613-py3-none-any.whl

Download URL xcamera-2020.613-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd72a731602d5ba124fe6755c06dadac537cb3de5fbf9a6b5f8c596dcd5040fa
BLAKE2b-256 checksum
How to use checksums
a766eb4c1bd5eef33c0688e38275f904ea82eb8902bd424b8983e09d27b26f78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release history Release notifications | RSS feed

This release

2020.613 This release

2 release files

0.0.1

2 release files

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