Video Demo: https://youtu.be/7Hnv1ig3hUc
SeeColours is a web-based application designed to assist individuals with color vision deficiencies (CVD) by distinguishing colours more effectively and simulating what a person with CVD sees based on a particular prognosis. Having CVD (Deuteranopia) myself, this project is stems from my interest in understanding it as both a medical condition and a computer science challenge.
This project is currently in development mode, focusing primarily on core CVD processing functionality rather than production-ready features. While user authentication and database integration are implemented as taught in CS50, these aspects would need significant enhancement for production deployment.
-
CVD Image Processing
- Simulate how images appear to individuals with differnet CVD prognoses
- Correct images for people with CVD using the Daltonize algorithm
- Support for custom and generic CVD profiles
-
User Management
- Personal account creation and authentication
- Storage of individual CVD test results
- Profile-based image processing preferences
-
Real-time Processing
- AJAX-powered previews
- Processing status feedback
- Allows for multiple prognoses and custom-user manipulation
-
app.py- Serves as the main Flask application entry point
- Manages user sessions and authentication
-
helpers.py- Contains utility functions for:
- File path management
- User authentication checks
- Implements santise measures for uploads
- Contains utility functions for:
-
image_processing.py- Houses the core CVD simulation and correction algorithms
- Implements two major models:
- MacHado, Oliveria and Fernandes (2009) for Deutan and Protan cases
- Brettle (1997) for Tritan cases
CVD simulation and Daltonize algorithm
- Convert uploaded image from sRGB to linear RGB for accurate color processing
- Transform to LMS colorspace, which is calibrated to human cone responses
- Project colors along "confusion lines" specific to each type of CVD
- For daltonization, calculate and redistribute lost color information
- Convert processed image back to standard RGB format
-
Base Templates
layout.html: Main template with navigation and Bootstrap integrationindex.html: Dashboard showing user's test results and statusabout.html: Educational content about CVD and usage instructions
-
User Management Templates
login.html: User authentication interfaceregister.html: New account creation formsubmit_test.html: Interface for CVD test result submission
-
Processing Templates
upload.html: Image upload interface with real-time feedback and image process selectionbase_simulator.html: Universal template for both simulation and correction modes
- stom CSS extending Bootstrap
- loads folder:
- Uloaded and processed images saved to this folder
- Clone the repository
- Install dependencies:
pip install -r requirements.txt- Run the development server:
flask run-
Account Creation
- Register with a unique username and password
- Passwords are securely hashed before storage
-
CVD Profile Setup
- Take the EnChroma CVD test
- Submit results via the "Submit Test Result" interface
- Results are stored for personalized processing
-
Image Processing
- Upload images (PNG/JPEG, max 2MB)
- Choose processing mode:
- Simulate: View how images appear to individuals with CVD
- Daltonize: Correct images for better color distinction
- Apply adjustments using either:
- Personal CVD profile
- Generic CVD profiles (Protan/Deutan/Tritan)
- Download processed images
-
Technology Stack Selection
- The technology stack, being the CS50 web app curriculum, was a prior to the project.
-
Focus on Core Functionality
- Prioritized accurate CVD simulation over scalability
- Implemented real-time AJAX previews for better user experience
- Created dual-mode processing (simulation and correction)
-
User Experience Decisions
- Included both custom and generic CVD profiles for accessibility
- Added immediate visual feedback during processing
-
Security Implementation
- Basic password hashing and session management as per CS50
- Input sanitization for all user-submitted data
- Simple file type verification for uploads
- CS50’s Flask environment which by design is in dev mode
- Basic authentication system (not production-ready)
- Local file storage (needs cloud integration)
- Limited testing for edge cases
- Technical Challenges
- Understanding color space transformations for accurate simulation
- Implementing complex CVD models
- Managing real-time image processing and feedback
-
Color Analysis Tools
- Hover-based color identification
- Problematic color palette generation
- Isolate problematic areas of the image
-
Interface Improvements
- Upload history tracking
- Processing preset management
- Enhanced visual feedback systems
-
Infrastructure
- Cloud-based image storage implementation
- Migration to a more robust database system
- Enhanced security measures
- Proper user authentication system
-
Performance Optimization
- Image processing optimization
- Processing time reduction
- Batch processing capabilities
-
DaltonLens.org (https://daltonlens.org/opensource-cvd-simulation/)
- Primary resource for CVD simulation understanding
- Model implementation guidelines
- Algorithm validation methods
-
Machado, G. M., Oliveira, M. M., & Fernandes, L. A. F. (2009). A Physiologically-based Model for Simulation of Color Vision Deficiency. IEEE Transactions on Visualization and Computer Graphics.
-
Brettel, H., Viénot, F., & Mollon, J. D. (1997). Computerized simulation of color appearance for dichromats. Journal of the Optical Society of America A.