Forum » Development Discussion


    • Koant sa...
    • Användare
    • 9 mar 2008, 10:48



    Inspired by Gijsco's Desktop Generator, unfortunately unavailable on linux, I wrote a bash script which generates a collage of the album covers in your profile, à la webcollage. I call it lastCollage and you can find it, with instructions, at

    Here is an example of what it does with my profile:

    Comments welcome.
    (thanks to for making the data available)

    • Koant sa...
    • Användare
    • 13 mar 2008, 09:05

    Tested on Mac and Windows

    The script works on Mac and Windows. I've added some instructions for both at

    • tburny sa...
    • Forum Moderator
    • 13 mar 2008, 23:02
    sounds nice, I'll give it a bookmark for later on^^ Combine your favourite radio stations! | My Blog | scala-lastfmapi | Cache2k - A high performance Java in-memory cache
    P.S.: Do not click here
    throw new PokemonException(); //Gotta catch 'em all
    My forum post reflects my personal opinion :)
    • juxi sa...
    • Användare
    • 17 mar 2008, 11:34
    At first the image was blank. After some digging around I found out Ubuntu doesn't have xsltproc installed by default. After installing that all worked out perfect.

    I was also wondering is it possible to make the script be less aware of the edges of the picture? I find the black areas unneeded :) I could of course just make the background picture be way larger than my desktop actually is and then just crop it to the size I want, but I'd like the script to do this for me :)

    • Koant sa...
    • Användare
    • 17 mar 2008, 16:46
    Thanks for the comments.
    juxi: Yes, what you're describing is actually the first version of the script :) I'll add it shortly.

    • Koant sa...
    • Användare
    • 19 mar 2008, 14:11

    New: possibility of changing the canvas size

    Following juxi's suggestion, I've added the canvas size in the parameters. The canvas is the surface which the album covers are pasted on and can be of a different dimensions than the final image. In particular, you can now obtain an image without a black border.

    See for more information.

    • juxi sa...
    • Användare
    • 20 mar 2008, 14:02
    Thanks a heap! Just what I was looking for :)

    • Koant sa...
    • Användare
    • 21 mar 2008, 07:28
    My pleasure!

    • [Raderad användare] sa...
    • Användare
    • 23 mar 2008, 01:14
    Thank you very much for your script!

    Personally, i would love to have an option to row the images without spin and disortion like some other generators do... (nevertheless, i prefer yours because i can make a cronjob for it!)

    • Koant sa...
    • Användare
    • 23 mar 2008, 09:32
    Re: the other generators, I'll think about it. Note that if you set AlbumOpacity to its maximum (100) and GradientSize to its minimum (1), the covers are not blended into each other, as with the other generators.

    • [Raderad användare] sa...
    • Användare
    • 23 mar 2008, 10:34
    yeah thats my current setting... but it doesnt fill my screen and leaves black parts... probably because i dont have enough albums scrobbled... i think it would be ok to double some album pictures, just to fill the screen with covers.

    Im not that much into bash-scripting and imagemagick, but i will try to hack it myself to my needs - if it works i'll submit it to you!

    Thank you for your reply!

  • what the hell is that???

    this is the most user-unfriendly stuff EVER MADE man, so congratz. I really won't spend 2 hours by finding out how to put wget in my command line or how the hell I'm supposed to put a string of code in a directory... as I can see I'll look now to all the ppl here as complete PC noob, but I really don't now how I'm supposed to get this to work. I'm forced to stay with the wallpapergen that Gijsco made

    I don't wanna be your friend.
  • ois

    aaah... a linux environment for windows... ever heard about the kind of PC users that have MS Windows simply because they can actually USE their computer with it? I'm one of them, that does it

    I don't wanna be your friend.
    • Koant sa...
    • Användare
    • 23 mar 2008, 12:15
    Hello Windows user.

    It's a bash script, so to make it run on Windows requires a bit of work. I admit it's not point-and-click . In the next version, no file editing will be necessary , so it'll be easier to customize.

    As indicated in the webpage, you need to have cygwin installed, which is a linux environment running in Windows.

    Actually, one of the reasons I made the script in the first place was because I didn't know of any wallpaper generator that worked on linux. The fact that it can (mod some efforts) work on Mac and Windows is an added bonus.

    Maybe you could ask Gijsco to add the random collage to his already very nice app. (I would suggest using a different tone though, if you want people to do things for you.)

    Redigerad av Koant den 23 mar 2008, 18:31
    • Koant sa...
    • Användare
    • 23 mar 2008, 18:30

    No need to edit anymore.

    Dear all,

    You can now pass the parameters (username etc.) directly in the command line, so there is no need to edit the script anymore.
    For example:
    will run with the default values.

    ./lastCollage -u YesusFist -f 640x480 -a 150 -c 790x630
    will generate a small (640x480) collage using a canvas size of 790x630, with album size of 150 pixels, using YesusFist's profile.

    • Koant sa...
    • Användare
    • 26 mar 2008, 09:37

    a web version

    I've just added a web version, which allows you to generate a small (640x480) collage without having to install the script.

    It's limited in the sense that options cannot be changed but it should give you an idea of what the script does with your profile.

    It's here:

    (I might have to stop this service at some point so so enjoy it while it lasts.)

    • peddro sa...
    • Användare
    • 26 mar 2008, 17:19
    If you run the script on Mac OS X and getting only black images and the message

    "./lastCollage: line 178: seq: command not found"

    Edit the lastCollage script, search for seq and replace it with the word "jot" (without the quotes offcourse :) )

    "The most important things are not things"
    • Koant sa...
    • Användare
    • 26 mar 2008, 17:29
    ah thank you for the tip! I used seq in the latest version of the script, which I haven't tested on Mac.

    • Koant sa...
    • Användare
    • 27 mar 2008, 08:48
    Re: 'seq' I've now replaced it with a 'for' loop, so the script should work on Mac without any changes. Thanks again for your comment.

  • error

    getting this when I run ./lastCollage

    Preparing the list of pictures...
    Preparing the mask...
    ./lastCollage: line 192: convert: command not found
    Preparing the background...
    ./lastCollage: line 201: convert: command not found
    Add images (might take a while)...
    iteration 1 of 1

    ./lastCollage: line 215: convert: command not found
    ./lastCollage: line 219: convert: command not found
    Darken the final image...
    ./lastCollage: line 227: convert: command not found
    Finished! Image saved in hippyrandall.jpg

    the line 215 and 219 repeat numerous times. Any idea what is causing this?

    ...if you wanna live life on your own terms
    Ya gotta be willing to crash and burn...
    ~Motley Crue
    • Koant sa...
    • Användare
    • 11 apr 2008, 14:58
    Hippyrandall has solved his problem but just for future reference: convert is part of ImageMagick, which was not installed.

  • solved

    ty Koant I forgot to post solved here.
    Great script!

    ...if you wanna live life on your own terms
    Ya gotta be willing to crash and burn...
    ~Motley Crue
  • I'm using Arch Linux and had to install the package bc. After that the tool works great. Maybe it would be good to take this into the dependecies.

    It could also be good to test the necessary commands before execute it for the image.
    Then there will come error messages that the commands are not installed and the script can't be executed.

    Good work though!

    • Koant sa...
    • Användare
    • 29 apr 2008, 15:48
    Thank you for the suggestion. I've added a dependency check in the latest version.


    • Koant sa...
    • Användare
    • 15 maj 2008, 07:58

    Faster, more versatile...

    and actually not a bash script but a Python script, here is the new version:

    The only requirement is Python (and the Python Imaging Library). If you're on linux, you probably have those already.
    The script can do 3 different wallpapers and is much faster than lastCollage.

    Hope you like it!
    Comments and questions welcome.

Anonyma användare kan inte skriva inlägg. Vänligen logga in eller skapa ett konto för att göra inlägg i forumen.