Make WordPress Core

Opened 22 months ago

Last modified 20 months ago

#56151 new enhancement

Port Dominant Color from performance plugin to core

Reported by: pbearne's profile pbearne Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch has-unit-tests has-dev-note
Focuses: Cc:

Description

As part of the performance module life cycle, we want to port this site health check to the core.
https://github.com/WordPress/performance/tree/trunk/modules/images/dominant-color

Performance issue GH link: https://github.com/WordPress/performance/issues/417

Change History (11)

#2 follow-up: @joyously
22 months ago

When I was writing a similar function, I noticed that using a 1 x 1 resize results in a muddy color that is sort of the average of the colors in the image, but not any of those colors.
The test cases use a lot of single color images to test with, so you might not see this.

spacedmonkey commented on PR #2906:


22 months ago
#3

@pbearne Coding standard issues.

#4 in reply to: ↑ 2 @pbearne
22 months ago

Replying to joyously:

When I was writing a similar function, I noticed that using a 1 x 1 resize results in a muddy color that is sort of the average of the colors in the image, but not any of those colors.
The test cases use a lot of single color images to test with, so you might not see this.

Yes, the colors are muddy/muted which is fine for this use

This ticket was mentioned in PR #3164 on WordPress/wordpress-develop by pbearne.


20 months ago
#6

this version has a theme feature flag option

Trac ticket: https://core.trac.wordpress.org/ticket/56151

This ticket was mentioned in PR #3164 on WordPress/wordpress-develop by pbearne.


20 months ago
#7

this version has a theme feature flag option

Trac ticket: https://core.trac.wordpress.org/ticket/56151

spacedmonkey commented on PR #3164:


20 months ago
#8

All references to dominant_color_ function names should be renamed to wp_dominant_color_

spacedmonkey commented on PR #3164:


20 months ago
#9

@pbearne Before assigning me to code review, please ensure that coding standards and unit tests are passing.

#10 follow-up: @davidbaumwald
20 months ago

Thinking and talking about this during WCUS, I am on board with gathering the dominant color of the image on upload and saving it with the rest of the serialized metadata.

However, I still think the usage of the meta should purely be a theme decision. Duotone images were one instance I thought about where a user would potentially get a color not represented in the image.

#11 in reply to: ↑ 10 @pbearne
20 months ago

Replying to davidbaumwald:

Thinking and talking about this during WCUS, I am on board with gathering the dominant color of the image on upload and saving it with the rest of the serialized metadata.

However, I still think the usage of the meta should purely be a theme decision. Duotone images were one instance I thought about where a user would potentially get a color not represented in the image.

that is why we have added the theme support flag so fin grain control can be done via the theme :-)

Note: See TracTickets for help on using tickets.