[howto] Simple Avatar maker (from screenshot)


Recommended Posts

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.

  • 4 weeks later...

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

  • 1 month later...
  • 3 years later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • RevPDF 4.5.0 by Razvan Serea RevPDF is a free, fully offline PDF editor for Windows, macOS, and Linux that lets you edit text and images directly inside PDF files — no internet connection, no account, and no cloud uploads required. Unlike bloated alternatives that demand subscriptions and constant connectivity, RevPDF fits in under 60MB on desktop while delivering a complete editing toolkit: annotate, redact, sign, compress, split, merge, convert, and reorganize pages, all processed locally on your device. Smart font matching ensures edited text blends seamlessly with the original, and multi-language support includes RTL scripts such as Arabic and Hebrew. Where most PDF editors force you to choose between features and simplicity, RevPDF manages both. You can build interactive forms from scratch with text fields, checkboxes, and dropdowns, permanently redact sensitive data before sharing, draw freehand on contracts and diagrams, and add custom watermarks — all without a single file leaving your machine. Edit Text and Images Directly Inside PDFs RevPDF supports true inline PDF editing — not just annotation layers on top of a document, but actual modification of existing text and images within the file. A smart font-matching engine identifies the font used in the original document and applies it automatically when you make edits, so changes blend naturally with the surrounding content. You can reposition elements, resize images, and update text across single pages or entire documents. RevPDF 4.5.0 release notes: This is one of the biggest updates to RevPDF yet. A lot of things people have been asking for are finally here. New Features Auto Redaction Permanently redact sensitive text and areas from your PDFs before sharing. Clean, irreversible, and fully offline. Comments, Links & Bookmarks Add comments for review, insert clickable links, and create bookmarks to jump around long documents without scrolling forever. Find & Replace Search across the whole document and replace text in one go. Long overdue. Split Pages Vertically or Horizontally Split any page down the middle, vertically or horizontally. Perfect for scanned books or double-page spreads. New Drawing Tools More tools for freehand drawing and markup, better for annotations, sketches, and detailed notes. Continuous Scrolling in Editor The editor now scrolls continuously through pages instead of jumping between them. Working through long documents is a lot smoother now. PDF Metadata Editor View and edit the metadata stored inside your PDFs, including title, author, subject, and keywords. Better Font Matching Text edits now blend in more naturally by doing a better job of matching the original font. Tabbed PDF Viewer Open multiple PDFs at once in tabs and switch between them without going back to the home screen. Add Links Insert hyperlinks anywhere in your PDF, to external URLs or to other pages within the document. Share & Print Shortcuts Share or print directly from the editing screen, home screen, and viewer. No extra steps. Minor Updates Paste images directly from clipboard into your PDF New image editing tools for more control over images inside documents Bug Fixes Fixed file saving issues on Windows and Linux Everything still works fully offline. No login, no cloud, no account. Your files stay on your device. Download: RevPDF 4.5.0 | 58.0 MB (Open Source) Links: RevPDF Home Page | Github | Screenshots 1 | 2 Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Interesting. I'm not using a VPN with my phone. I tried though my home internet (Rogers) and my cellular internet (Telus) and both trigger the dialog above.
    • Three days after Anthropic launched Claude Fable 5 as the most capable AI model it had ever released to the public, the United States government ordered it switched off — and now the company is refunding customers who paid to use a product that vanished almost overnight https://www.techtimes.com/articles/318342/20260613/us-government-pulls-anthropics-fable-5-offline-now-come-refunds-vanished-ai.htm  
    • Microsoft fired the team and replaced them with AI and this is what you get.
    • iPhone 18 Pro Camera Goes Mechanical: Variable Aperture, 2nm Chip, Dark Cherry Due September https://www.techtimes.com/arti...rk-cherry-due-september.htm Apple Liquid Glass iOS 27: WWDC 2026 Brings Refinements Developers Must Adopt Today https://www.techtimes.com/arti...lopers-must-adopt-today.htm Apple WWDC 2026: Siri Rebuilt on Gemini, homeOS Previewed in Cook Farewell Keynote https://www.techtimes.com/arti...d-cook-farewell-keynote.htm
  • Recent Achievements

    • Week One Done
      agatameier earned a badge
      Week One Done
    • One Month Later
      agatameier earned a badge
      One Month Later
    • Week One Done
      ssd21345 earned a badge
      Week One Done
    • Contributor
      MarkHughes4096 went up a rank
      Contributor
    • Dedicated
      jordanspringer earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      507
    2. 2
      +Edouard
      175
    3. 3
      PsYcHoKiLLa
      139
    4. 4
      ATLien_0
      90
    5. 5
      Steven P.
      76
  • Tell a friend

    Love Neowin? Tell a friend!