Skip to content

Replace pywal with a new ImageMagick color extraction, and custom algorithm.#20

Merged
bjarneo merged 10 commits into
mainfrom
color-extraction
Oct 20, 2025
Merged

Replace pywal with a new ImageMagick color extraction, and custom algorithm.#20
bjarneo merged 10 commits into
mainfrom
color-extraction

Conversation

@bjarneo
Copy link
Copy Markdown
Owner

@bjarneo bjarneo commented Oct 19, 2025

You might ask the question why, and it is easy to answer.
The reason for throwing away pywal, regardless of how great it works, is to get full control. It can be tweaked as I want to, and it is quicker, more stable, and handles edge cases where pywal will just throw.

Always challenge the status quo.

Copilot

This pull request removes all dependencies on pywal for color extraction and fully migrates the application to an advanced ImageMagick-based color extraction system. The documentation, UI, and service layer have been updated to reflect this major architectural change. Additionally, the user workflow and palette generation have been improved with smarter, adaptive algorithms and new wallpaper browsing features.

Color Extraction System Overhaul

  • Replaced all references and usage of pywal with an intelligent ImageMagick-based color extraction algorithm, including automatic image classification, adaptive palette generation, brightness normalization, and caching for fast re-extraction. (CLAUDE.md [1] [2] [3] [4] [5] [6] [7] src/components/PaletteGenerator.js [8] [9] [10] [11] [12] src/services/wallpaper-service.js [13] src/utils/image-filter-utils.js [14] [15] CLAUDE.md [16] [17] [18] [19] [20]

UI and Workflow Improvements

  • Updated the palette editor and wallpaper browser to use the new extraction method, added new sub-tabs for local and favorite wallpapers, and improved button labeling and tooltips to reflect the new workflow. (CLAUDE.md [1] src/components/PaletteGenerator.js [2] [3] [4] [5]

Documentation and Dependency Updates

  • Revised all documentation and installation instructions to remove pywal and require only ImageMagick for both color extraction and wallpaper filtering. (README.md [1] [2] [3] [4] [5] CLAUDE.md [6] [7] [8]

Codebase Cleanup

Resilience and Caching

  • Improved caching mechanisms for color extraction and processed wallpapers to ensure instant re-extraction and avoid stale results. (src/utils/image-filter-utils.js [1] [2] CLAUDE.md [3] [4]

These changes modernize the application's color extraction capabilities, simplify dependencies, and provide a smarter, more flexible theming experience for users.

@bjarneo bjarneo requested a review from Copilot October 19, 2025 20:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request removes the dependency on pywal for color extraction and replaces it with a custom ImageMagick-based color extraction system. The new algorithm provides intelligent image classification, adaptive palette generation, and improved caching.

  • Introduces a comprehensive ImageMagick-based color extraction utility with automatic image type detection and adaptive palette strategies
  • Updates the UI workflow to use the new extraction method with improved button labeling and tooltips
  • Removes all pywal dependencies and references throughout the codebase and documentation

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils/imagemagick-color-extraction.js New comprehensive color extraction utility with intelligent algorithms and caching
src/utils/image-filter-utils.js Updated comments to reflect new color extraction system
src/services/wallpaper-service.js Removed entire pywal integration service
src/main.js Added blueprint service initialization check
src/components/PaletteGenerator.js Updated to use new ImageMagick extraction method
README.md Updated installation instructions and workflow descriptions
CLAUDE.md Updated project documentation to reflect new extraction system

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +526 to +529
const hsl = getColorHSL(hexColor);
const newLightness = Math.min(100, hsl.l + BRIGHT_COLOR_LIGHTNESS_BOOST);
const newSaturation = Math.min(100, hsl.s * BRIGHT_COLOR_SATURATION_BOOST);
return hslToHex(hsl.h, newSaturation, newLightness);
Copy link

Copilot AI Oct 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeated calls to getColorHSL() in the same function could be optimized by caching the HSL conversion result, especially in functions like generateBrightVersion() where the same color is processed multiple times.

Copilot uses AI. Check for mistakes.
Comment thread src/main.js
Comment thread src/components/PaletteGenerator.js Outdated
}

this._extractButton.set_visible(true);
// this._extractButton.set_visible(true); // Pywal button commented out
Copy link

Copilot AI Oct 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented-out pywal code rather than leaving it in the codebase. The old implementation is preserved in version control history if needed.

Copilot uses AI. Check for mistakes.
Comment thread src/components/PaletteGenerator.js Outdated
@bjarneo bjarneo merged commit 96f73b5 into main Oct 20, 2025
1 check passed
@bjarneo bjarneo deleted the color-extraction branch October 20, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants