Skip to content

MrLixm/streamlit-colour-plotting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

121 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

streamlit_colourplotting

A streamlit web-application allowing to plot colors on a CIE Diagram using the colour-science library.

screenshot of the web-app

The application allow to plot a single R-G-B color or a whole image using various methods. A lot of options allow you to customize how the final diagram looks.

Usage

You can either access the app on the web at https://colour-plotting.streamlit.app/ or run it locally on your machine.

For running it locally you will need:

  • uv installed on your machine: https://docs.astral.sh/uv/getting-started/installation/

    • optionally you can also just download the uv executable somewhere and copy its path. And instead of calling just uv in the next commands, you call the path to uv.
  • this repository downloaded anywhere on your machine

Once this is done, open a terminal and run the following commands:

cd /path/to/downloaded/repo
uv run python -m streamlit run src/app.py --server.headless true

A message with an url should appear, ctrl+click on it your terminal supports it, else copy the url in your web-browser.

Configuration

Environment Variables

  • STCP_ENABLE_SIZE_LIMITATIONS : to set with any non-empty value. Enable a 2048 size limitation for images upload (useful when web-hosted).
  • STCP_APP_LOG_LEVEL : set the python application logger level. Except a python log level in upper case. ex: WARNING

Logic

Streamlit use a single file as entry point that is re-run everytime a widget change on the web GUI.

This file is located in ./src/app.py. It is quite empty and only import the python package streamlit_colourplotting which define everything.

A important concept to understand :

  • streamlit re-run app.py from top to bottom everytime
  • but python cache imported package on their first import

This mean that anything in the global scope will be shared along users. This why the "config" system store everything in session_state instead of python global variables.

Profiling

As streamlit cloud machine are limited in ressources, it's a good idea to check the memory profile of our app.

Once the streamlit app is started you can run the profile-running-streamlit.sh script and follow its intrsuction (make sure to launch it with the current directory being the root of this repo).

About

Web-app to plot colors, images and colorspaces in graphs.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors