• It’d be very helpful if this plugin could be updated to include a function for retrieving the dominant color of any image; for example, say my theme has a hard-coded image in the footer that I want to lazy load. I suppose I could just manually specify the color and transparency stuff, but it’d be nice if I could simply run the URL (or file path) through a function like dominant_color_get_from_path("https://www.example.com/wp-content/themes/my-theme/assets/media/my-background.jpg")

Viewing 1 replies (of 1 total)
  • Hi @revxx14,

    If there is a filter you would like to be introduced, you can submit a feature request over on the plugins GitHub repository:
    https://github.com/WordPress/performance

    As the plugin works with newly uploaded images, you may also wish to regenerate images using wp-cli or a plugin. This may allow the plugin to add placeholder images. I didn’t test this myself, but I certainly will based on your query. I’m not sure how this would work with theme introduced images, hardcoded into theme files. I’m happy to test this if you’re aware of a theme that does this by default, for example a theme that have a default post featured image.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.