星期一, 11月 22, 2010

以Python為工具和Last.fm上的專輯封面為素材製作出專屬自己的桌面桌布---Wallpaperfm.py

2010-11-21005

若你是Last.fm的使用者,可以使用Wallpaperfm.py將你曾經所聽過的歌曲紀錄的專輯封面拼貼成一幅專屬於你自己的神奇且獨特的桌面桌布。而要使用這個程式腳本也非常容易,不論你的作業系統是Linux、Mac或是Windows等,只要系統能夠支援Python應該都能夠順利來使用。
在Linux或是Mac上使用時,在終端機程式上輸入如下:
cd
mkdir wallpaperfm
cd wallpaperfm
wget http://ledazibao.free.fr/wallpaperfm/wallpaperfm.py
chmod a+x wallpaperfm.py
./wallpaperfm.py -u YOURLASTFMUSERNAME -m 所要模式及其他參數...

在 Windows上使用時,因為Windows系統預設沒有對Python語言的支援,所以要先下載Python的Windows版本及其相關模組檔案 PIL(Python Imaging Library),請注意PIL支援版本必須要和Python版本相合,Python版本請下載x86版本即可。
Python和PIL安裝好後,利用命令提示字元打開Wallpaperfm.py所在檔案的資料夾即可
X:/wallpaperfm/wallpaperfm.py -u YOURLASTFMUSERNAME -m 所要模式及其他參數...

wallpaperfm.py內共有三種模式即tile、glass和collage,而這三種模式各有其參數如下:

tile mode (-m tile):
-a, --AlbumSize: [130] size of the albums, in pixel.
-s, --Interspace: [5]  space between in tile, in pixel.

X:/wallpaperfm/wallpaperfm.py -u YOURLASTFMUSERNAME –m tile

tile.jpg

glass mode (-m glass):
-n, --AlbumNumber: [7] number of albums to show.
-d, --EndPoint: [75] controls when the shadow ends, in percentage of the album s
ize.
-r, --Offset: [40] starting value of opacity for the shadow.

X:/wallpaperfm/wallpaperfm.py -u YOURLASTFMUSERNAME –m glass

glass.jpg

collage mode (-m collage):
-a, --AlbumSize: [250] size of the albums, in pixel.
-o, --AlbumOpacity: [90] maximum opacity of each album, from 0 to 100.
-n, --AlbumNumber: [50] number of albums to show.
-g, --GradientSize: [15] portion of the album in the gradient, from 0 to 100
-p, --Passes: [4] number of iterations of the algorithms.

X:/wallpaperfm/wallpaperfm.py -u YOURLASTFMUSERNAME –m collage

collage.jpg


對於wallpaperfm.py整體而言其主要的參數如下:
-u, --Username: your last.fm username.
-f, --Filename: the filename where the image will be saved. Username by default.
-t, --Past: [overall] how far back should the profile go. One of 3month,6month,12month or overall.
-O, --FinalOpacity: [80] darkness of the final image. from 0 to 100
-i, --ImageSize: [1280x1024] size of the final image. Format: numberxnumber
-c, --CanvasSize: size of the canvas. = image size by default.
-e, --Cache: [wpcache] path to the cache.
-x, --ExcludedList: ['http://cdn.last.fm/depth/catalogue/noimage/cover_med.gif']
excluded urls, comma separated.
-l, --Local: use a local copy of the charts. Ideal for using it offline or being
kind to the last.fm servers.
因此利用這些參數來製作出屬於自己的桌布為例:
X:/wallpaperfm>wallpaperfm.py -u xxxxxx -t 12month -p 20 -n 200 -i 2560x1600 -c 3000x2000 -a 150 -o 100 -g 10 -m collage -f mywallpaper -O 85

mywallpaper1280.jpg

若要更清楚的說明,請參考其開發或下載網站。

附記:

上一篇貼文: HTC Home for Windows—Windows系統桌面上的實用工具

Share this post :

Powered by Windows Live Writer 2011 and Google文件

沒有留言: