PHP Classes

What is the best PHP get dominant color from image class?: Extract and organize scanned images by dominant color

Recommend this page to a friend!
  All requests RSS feed  >  What is the best PHP get dominant col...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

What is the best PHP get dominant color from image class?

A request is featured when there is no good recommended package on the site when it is posted. Edit

Picture of candace diane arledge by candace diane arledge - 3 years ago (2021-07-15)

Extract and organize scanned images by dominant color

This request is clear and relevant.
This request is not clear or is not relevant.

+1

I have a large number of images and need them sorted by color.

I have a huge file of images used for scrapbooking, and I need them to be sorted into individual folders for each primary color.

I need each file to be sorted into folders based on full-page (background) images or not.

Ask clarification

2 Recommendations

PHP Auto Style Fixer: Beautify PHP source code fixing its style

This class can beautify PHP source code fixing its style.

It can take as parameter PHP source code either in the form of a string or the name of a file to be parsed using pure PHP code.

The class can fix several types of formatting aspects of the given PHP source like:

- Remove multiple consecutive line breaks
- Remove needless spaces in statments like for, while, if, etc.
- Remove indenting
- Reformat comments
- Etc..
This recommendation solves the problem.
This recommendation does not solve the problem.

0

Picture of van Gato by van Gato Reputation 50 - 3 years ago (2021-07-16) Comment

But if you look for something very fast - take a look over here:

github / gaffling / PHP-Simple-Color-Thief


PHP Detect Image Background Color: Detect the dominant color used in an image

This class can detect the dominant color used in an image.

It can take the path of an image file in JPEG or PNG formats and can create a scaled down image that will uses mainly the color that is dominant in an image.

The class can return the image dominant color as a string on RGB format or HTML tags to create an empty page with the body background color set to the image dominant color.
This recommendation solves the problem.
This recommendation does not solve the problem.

0

Picture of Manuel Lemos by Manuel Lemos Reputation 26695 - 3 years ago (2021-07-16) Comment

Hello Candace,

That is a good problem. It seems to have several parts.

For detecting the dominant color of an image, you may try this package above as it seems to do what you want.

Then, to sort the images by color, maybe you need a solution that considers that close colors may go in the same folder.

In that case, maybe some other colleague developer can recommend a different package or develop a new package for that problem.

Just reply here to let me know if this recommendation helped you.

  • 1 Comment
  • 1. Picture of Hassane Moussa by Hassane Moussa package author package author - 3 years ago (2021-07-16) Reply

    Hi Lemos, I can updating this package (PHP Detect Image Background Color) to add the solution of this problem. I just wait your agree ! Best regards, Hassane Moussa


Recommend package
: 
: