Skip to main content

A streamlit module integrating cropperjs

Project description

Streamlit-cropperjs

Integrating the amazing cropperjs with streamlit.

This streamlit module is primarily built with mobile usage in mind.

Demo

Access the demo app here: https://st-cropperjs.streamlit.app/

Installation

pip install streamlit-cropperjs

Example

import streamlit as st

from streamlit_cropperjs import st_cropperjs

pic = st.file_uploader("Upload a picture", key="uploaded_pic")
if pic:
    pic = pic.read()
    cropped_pic = st_cropperjs(pic=pic, btn_text="Detect!", key="foo")
    if cropped_pic:
        st.image(cropped_pic, output_format="PNG")

Features

  • Crop and return image data
  • Supports touch (mobile)
  • Supports cropping on demand with a button (customised button text)

Future Development

  • Support for all cropperjs options
  • Support for cropperjs v2

References

https://github.com/fengyuanchen/cropperjs

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

streamlit-cropperjs-0.0.8.tar.gz (369.9 kB view details)

Uploaded Source

Built Distribution

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

streamlit_cropperjs-0.0.8-py3-none-any.whl (373.3 kB view details)

Uploaded Python 3

File details

Details for the file streamlit-cropperjs-0.0.8.tar.gz.

File metadata

  • Download URL: streamlit-cropperjs-0.0.8.tar.gz
  • Upload date:
  • Size: 369.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for streamlit-cropperjs-0.0.8.tar.gz
Algorithm Hash digest
SHA256 048256d46ec00a2c2fd9ce265028cae4a18b03f7e408cd3b0f3f6acbf721a45e
MD5 46175d9d999dac3640f8333c904735ba
BLAKE2b-256 da3387c21d1202d698de5e93197be91b4c4ef068175be282da30eb93a58f29cd

See more details on using hashes here.

File details

Details for the file streamlit_cropperjs-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_cropperjs-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7302251ffe2c3f78400d4ed2e35628adccf923ad526f3adab0992ba463188c94
MD5 6e04ed576f72bcba78f7ce668c1d40a5
BLAKE2b-256 d63d7a534b9cd66108de2ae45e3cb2470b3cef5f2ce2fbb6e0336c61386a0090

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