Search code examples
phpjavascriptpythonhtmlphotos

How do you programmatically add soft focus to an image


I was wondering how to go about adding soft focus (to blur an image a little bit) The way path.com does on the this page https://path.com/p/35p8q5 (the background image). I dont know if this is possible without using photoshop.


Solution

  • The go-to library (for PHP, Python …) is ImageMagick. Among other, this allows blurring.

    Adapting the basic usage example:

    <?php
    header('Content-type: image/jpeg');
    
    $image = new Imagick('image.jpg');
    $image->blurImage(5, 3);
    echo $image;
    ?>