How to easily generate low quality image placeholders (lqip) in WordPress
I have made this function using the WP_Image_Editor class and I have filtered through the "wp_generate_attachment_metadata" hook. You can modify the "theme" namespace into function names with your theme name or in anyway you like.
Applying the filter directly to wp_generate_attachment_metadata the image placeholders are auto added into WordPress metadata, so when your add/modify/delete an image (or regenerate it via a plugin), it accomplishes to modify also to the image placeholders.
The use of the native theme support can prevent the generation of lqip or target specific image sizes to generate.
It contains an hook filter lqip_quality to modify the quality without have to modify the function.