Advertisement


Batch convert portrait photo to landscape with blurred, extended background - Windows utility needed (NOT Photoshop)


Question

For a slideshow I want to extend 82 portrait images to landscape so that the image is duplicated as a blurred background, like this:

enter image description here

will be turned into

enter image description here

This is a one-shot-thing that I probably won't need again soon, so I'd need to use some free (or time limited trial) Windows utility for that. (I know that there are ways using Photoshop scripting, but I don't have Photoshop. I do have Corel PhotoPaint, if that's of any use.)

Do you know of any quick and dirty way to achieve this?

2016/04/08
1
1
4/8/2016 7:51:00 PM

@Metasomatism: Your comment lead me to the solution. If you change that to an answer I'll gladly accept it.

The command that does the trick is

for /f "delims=?" %f in ('dir *.jpg /b') do convert -size 1024x768 xc:skyblue "%f" -blur 0x25 -geometry 1024x768 -gravity northwest -composite "%f" -geometry 1024x768 -blur 0x25 -gravity southeast -composite "%f" -geometry 1024x768 -gravity center -composite "new_%f"

The commandline for ImageMagick is essentially this:

convert -size 1024x768 xc:skyblue 
        in.jpg -geometry 1024x768 -blur 0x25 -gravity northwest -composite
        in.jpg -geometry 1024x768 -blur 0x25 -gravity southeast -composite
        in.jpg -geometry 1024x768 -gravity center -composite
        out.jpg

which first creates an empy (well, light blue) canvas of the desired size (here 1024x768 as the images will be shown on an XGA beamer). Then the picture in.jpg is added three times: once in the topleft corner being heavily blurred, once more in the lower right hand corner, also blurred, and once in the center, this one unblurred. This yields the desired effect. It also handles panorama pictures, i.e. pics that are in wide landscape mode. Here, the blurred image is added to the top and bottom, whereas normal portrait pics the blurred pics are to the left and right.

2017/04/19
2
4/19/2017 4:20:00 PM