Add colour extraction Job#3411
Merged
ildyria merged 2 commits intocolor-extractionfrom Jun 7, 2025
Merged
Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
0203bfe to
780ff10
Compare
fca1e88 to
3b9b3bf
Compare
3b9b3bf to
fcbfd6c
Compare
fcbfd6c to
0073bb4
Compare
JasonMillward
approved these changes
Jun 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a feature for extracting dominant colors from images, along with supporting changes to integrate and test the functionality. The most significant changes include the addition of a new job for color extraction, a helper class for image processing, and updates to the database and configuration to enable this feature. Below is a breakdown of the key changes by theme:
Color Extraction Feature:
app/Jobs/ExtractColoursJob.php: Added a new job class,ExtractColoursJob, to extract the five most dominant colors from an image and store them in the database. It supports both GD and Imagick drivers for image processing.app/Image/Handlers/ImageFactoryForColourExtraction.php: Introduced a helper class,ImageFactoryForColourExtraction, to create image instances using either the GD or Imagick libraries for color extraction.Database and Configuration Updates:
database/migrations/2025_06_04_193132_optional_color_extraction.php: Added a migration to introduce a new configuration option,extract_colours_from_image, allowing users to enable or disable color extraction.app/Http/Middleware/ConfigIntegrity.php: Updated the configuration integrity check to include the newextract_colours_from_imagesetting.Enhancements to Models:
app/Models/Colour.php: Added a static method,fromHex, to create or updateColourinstances from hexadecimal strings.app/Models/Palette.php: Added a method,fromHex, to convert hexadecimal color strings to integer representations for storage.Dependency and Testing:
composer.json: Added thefarzai/color-palettelibrary as a dependency for color extraction functionality.tests/Feature_v2/Jobs/ExtractColoursJobTest.php: Created a test suite to validate theExtractColoursJob, ensuring it works correctly with both GD and Imagick drivers.These changes collectively enable the extraction and storage of dominant image colors, providing a foundation for enhanced image-related features.