How jefisha21-cell/image_compression_ml works
This is a single-file Streamlit image-compression dashboard. Users upload a JPG/PNG and choose k; the app converts the image to RGB pixels, projects them with PCA, clusters the projection with K-Means, and reconstructs pixels from cluster centers. It then presents the image comparison, compression metrics, dominant colors, PCA and RGB visualizations, and a JPEG download. These concerns share one implementation file, so the graph represents meaningful runtime stages rather than separate packages. Relationships are supported by the app.py excerpt; no other runtime modules appear in the source index.
Main entry points: app.py Color reconstruction
Components 12
Compression workflow
- Upload and k controls
app.py - RGB image pixels
app.py - PCA projection
app.py - K-Means clustering
app.py - Color reconstruction
app.py
Dashboard results
- Compression metrics
app.py - Image comparison
app.py - PCA analysis
app.py - RGB histogram
app.py - Dominant palette
app.py - JPEG download
app.py
Other components
- Image user
Connections 12
- Image user → Upload and k controls: uploads and selects
app.py - Upload and k controls → RGB image pixels: provides image and k
app.py - RGB image pixels → PCA projection: projects pixels
app.py - PCA projection → K-Means clustering: clusters projection
app.py - K-Means clustering → Color reconstruction: assigns centroid colors
app.py - Color reconstruction → Compression metrics: supplies compression results
app.py - Color reconstruction → Image comparison: renders compressed image
app.py - PCA projection → PCA analysis: reports variance
app.py - RGB image pixels → RGB histogram: plots RGB values
app.py - PCA projection → PCA analysis: plots projection
app.py - Color reconstruction → Dominant palette: shows cluster colors
app.py - Color reconstruction → JPEG download: encodes JPEG
app.py