Categories

Calendar

September 2018
M T W T F S S
« Jun    
 12
3456789
10111213141516
17181920212223
24252627282930

Backup & Restore WordPress Blog

Google recently released a tool for converting between different blogs. I haven’t tried that tool yet, but I guess you’d have two blogs simultaneously online for converting. So the traditional way of backing up the blog data is still necessary to prevent accidentally lost of data or planned blog migration.

WordPress provided a convenient way to […]

ImageMagick Tips: Shadow your picture (again)

我在之前的一篇 blog 中说过用 ImageMagick 来为图片加上好看的 soft shadow 的小计巧,我一直在用,觉得很方便,当时的脚本是这个样子:

1
2
3
4
5
#!/bin/sh
convert $1 -bordercolor white -border 6 \
-bordercolor grey60 -border 1 \
\( +clone -background black -shadow 60×4+4+4 \) +swap \
-background none -mosaic $1

不过其实由于使用了 -mosaic ,边缘的阴影被截断了,看起来很不好看,如下图,注意左下角和右上角的阴影部分:

参考 ImageMagick 的文档,也有解决办法,不过比较麻烦。幸运的是,从 ImageMagick 6.3.6-2 开始,我们可以使用 -layers merge 来完成这个任务,而且不会出现这样的不好看的边缘,脚本修改如下: