markwolfe Veteran Posted January 12, 2006 Veteran Share Posted January 12, 2006 Hey there, just playing a bit more with learning to script, and I have combined a few things to make a simple Linux bash script that will allow you to take a screenshot, superimpose your preferred "main" image on top of it (in my case, it is Opus the penguin), then upload it to an FTP site of your choice. It is a bit ugly (and I keep it in my home directory, inside a directory non-descriptively titled "temp". :ermm: I have it commented a bit, and would appreciate expert assistance to improve it (because I just know it is taking up extra intermediate steps that are not necessary and inefficient) :p Here it is: #!/bin/bash # ensure I am in the temp directory where I am doing this work cd ~/temp # take a screenie, sized down to 128x128 import -window root -resize 128x128 screenie.png # center it onto a 128x128 fully transparent png file composite -gravity center screenie.png blank_128.png step1.png # throw my 128x128 image of Opus over the top of the screenie composite -gravity center opus_face.png step1.png final.png # cleanup rm screenie.png step1.png # final resize to Neowin limits mogrify -resize 80x80 final.png # start FTP upload ftp -n ftp.site.com <<FTP-Session user username password binary put final.png bye FTP-Session # -n option to "ftp" disables auto-logon. With the ftp command above, the "<<" indicates that the following section (which I named "FTP-Session") is not bash code, but is to be passed to ftp as commands (just learned this today) :D The use of the name again marks the end of the section and returns to bash execution. Of course, change "ftp.site.com" to your ftp site address, and change "username" and "password" to your login name and password for that ftp site. This isn't exactly a revolutionary script, but I thought I would share it for those others who may be interested. (the ftp command scripting thing was very new to me!) EDIT: Oh yeah, I forgot to specify, the "blank_128.png" and "opus_face.png" files I used are pre-existing for this script to work right. You will have to create an appropriately-sized transparent .png and also find a suitable image you want plastered on the front yourself. Link to comment https://www.neowin.net/forum/topic/419593-howto-simple-avatar-maker-from-screenshot/ Share on other sites More sharing options...
MasterC Posted January 12, 2006 Share Posted January 12, 2006 Amazing! :yes: I have to try this out- thanks a lot Mark! :D Link to comment https://www.neowin.net/forum/topic/419593-howto-simple-avatar-maker-from-screenshot/#findComment-587053725 Share on other sites More sharing options...
The_Decryptor Veteran Posted February 9, 2006 Veteran Share Posted February 9, 2006 Interesting script, see if i can get it to work with my mac (it provides screenshot apps as well) ... With the ftp command above, the "<<" indicates that the following section (which I named "FTP-Session") is not bash code, but is to be passed to ftp as commands (just learned this today) :D The use of the name again marks the end of the section and returns to bash execution. ... Never knew that, gotta love bash Link to comment https://www.neowin.net/forum/topic/419593-howto-simple-avatar-maker-from-screenshot/#findComment-587174805 Share on other sites More sharing options...
ichi Posted February 9, 2006 Share Posted February 9, 2006 Nice idea, and interesting code :yes: Link to comment https://www.neowin.net/forum/topic/419593-howto-simple-avatar-maker-from-screenshot/#findComment-587175059 Share on other sites More sharing options...
Scott.Mc Posted March 25, 2006 Share Posted March 25, 2006 Good guide, but maybe you should point out that they need imagemagick installed. Link to comment https://www.neowin.net/forum/topic/419593-howto-simple-avatar-maker-from-screenshot/#findComment-587347073 Share on other sites More sharing options...
t_r_nelson Posted April 13, 2009 Share Posted April 13, 2009 I just want to know where the background image shown on your blog is found...yummy!!! Link to comment https://www.neowin.net/forum/topic/419593-howto-simple-avatar-maker-from-screenshot/#findComment-590848394 Share on other sites More sharing options...
Recommended Posts