Fix, Find, And Generate Contact Avatars On Linux Without (You) Using AI
ideatrash @ideatrash@ideatrash.net
In the space of less than twenty-four hours I went from idea to having a tool that solves a problem that I (and presumably others) have had for at least a decade:
Remove old placeholder user avatar images, see if there are any advertised online user avatars for the person, otherwise generate new and unique ones for each contact, and attach them across your whole address book. And without AI generated images, using my phone, or subscribing to a service.
How I did so also serves as a great example of what I mean by individual “harm reduction” when it comes to AI.
Let me explain what went into solving the problem, how and where I used AI/LLMs so that I didn’t need to keep using an AI, and why I think that difference is important.
This is really two posts in one; if you’re only interested in one bit or another, the headers should guide you to the right spot.
Fixing Bad Contact Avatars (Linux, Bash Script)
I don’t like most “default” icons in my contacts list. The only thing I like less than the “initials against colored background” is everyone having the same default user avatar. That is less-than-helpful when you are scrolling through a list of over a thousand contacts.


I have tried various services and schemes to solve this problem. From generic geometric identicons to small images pulled from social media or services like Gravitar, they all have failed in some way, with tiny pixeled avatars, being too abstract, not getting complete coverage, what have you. The geometric identicons, for example, are cool, but start blurring together due to their similarity.
And then yesterday I stumbled across DiceBear. It uses several different style sets in order to generate avatars based on whatever text you feed it as a string. Which means if you feed it an email address (or a hash of an email address) you’ll get the same result each time, so you get the same result when regenerating. You can even customize the variable colors and styles through the API, but the differences are striking with even small changes in the seed. (Critters by DiceBear, licensed under CC0 1.0 )


But this is still calling an API, which may fail in the future; it’s happened with other scripts of mine. Sure, there’s a CLI client, but it doesn’t have all the styles the website does. And what if someone has a Libravatar or Gravitar that actually represents them? And what about all those old identicons or small imported social media images? And can it not require my phone?
That’s the problem I’d had for a decade, and finally solved yesterday.
The scripts are in my multiple_scripts repository (Github, Gitea)
Side note I’m giving you the finished workflow here, all put in order as if it’s coherent. In reality, while putting it all together I got halfway done, had to stop and backtrack to figure out a new solution to a problem I hadn’t considered, and then start parts over again.
Remove Crappy User Icons
Assuming that you — like me — have your contacts files synchronized as VCards in a directory, first make a backup of them!
Then use clean_identicons_vcards.sh to scan that directory of VCards. The script will create ./output and export both a tab-separated list of which icons go to which VCard, as well as the ones suspected as being bogus. No AI used to detect poor-quality identicons; it just uses imagemagick to examine the size, number of colors, and symmetry of the image.
You can tweak how sensitive it is by raising the default numbers in each of these at the top of the script.
MAX_DIMENSION="${VCF_PLACEHOLDER_MAX_DIMENSION:-96}"
MAX_COLORS="${VCF_PLACEHOLDER_MAX_COLORS:-8000}"
FAST_SKIP_DIMENSION="${VCF_PLACEHOLDER_FAST_SKIP_DIMENSION:-128}"
Open up ./output and delete any image that you want to keep. Then run clean_identicons_vcards.sh --clean to remove the embedded PHOTO block only from cards whose exported review image still exists in ./output and whose current embedded photo still matches the recorded hash.
First, a script to help generate the avatars using Dicebear. dicebear_helper_generate_avatar.sh uses the website preferentially, but can fall back to the local CLI tool if needed. Give it a seed of any string (or let it use urandom if you don’t tell it anything) and it will not only return an avatar, but it’ll save it in a cache directory and copy it to your clipboard using xclip or copyq. (You can change the cache directory and turn off the clipboard storing).
But damn, now I have a whole bunch of VCards that don’t have photos, but I don’t know if they have an “official” avatar, and I’d rather use that first. And so: vcf_add_missing_dicebear_avatars.sh. It goes through your VCard files, skips those that already have a PHOTO, tries Libravatar first and then Gravatar for any non-placeholder email addresses on the card, and if both of those fail, falls back to the DiceBear helper above.
While doing so, I didn’t want to just create the same problem I had to solve with clean_identicons_vcards.sh, so when inserting any avatar, it adds X-DICEBEAR-GENERATED:TRUE and an X-DICEBEAR-SOURCE: value of dicebear, libravatar, or gravatar so they can be identified and removed later. And since I was already thinking about it, vcf_remove_dicebear_avatars.sh reverses the marked-avatar workflow for vCards.
The scripts are in my multiple_scripts repository (Github, Gitea), and should work on Debian/Ubuntu and derivatives like Mint and MX; Fedora, Arch, and Gentoo may need to install some packages, likewise on WSL for Windows. BSD and OSX+homebrew would require some tweaking, particularly since it’s BASH, not shell.
What does that have to do with how we use AI?
A few starting out points:
- AI (or AI/ML) is a huge umbrella, covering a wide range of technologies, with varying levels of usefulness, frivolity, and impacts. For the most part, when I say AI/ML here, I’m talking about the large cloud services that are associated with data centers and the like.
- A lot of the negative things about AI/ML are actually decisions made by the people owning the systems in order to extract profit. (e.g. ripping off artists is a choice, not an inevitability)
- “Generative” AI is inherently derivative and repetitive because of how it works.
Some of this is reflected in the ways I have used these tools. After initially using genAI images as NPC and player character portraits, I’ve largely abandoned the practice. I’ve wholly abandoned it in terms of handouts to my players; I now try to find some other photo or visual artwork reference when figuring out who an NPC is and what they look like. This is ultimately due to practical considerations: Not only are the images still very repetitive and derivative, but it knocks my players directly out of the story as they ask themselves (or me) if it was created with AI.
In contrast, a lot of my software repositories now have labels saying that AI was used in some way. Usually — though not always, and to varying degrees — that boils down to “find the bugs I can’t figure out how to squash” and “make the documentation complete” and “write a git commit message that isn’t just ‘trying something different’.” I’m fully aware that I should do better commit messages and tag messages so that others can audit and follow the code. I’m also fully aware that, despite my best intentions, in practice I do not.
For example, I’ve been spending time cleaning up the two big repositories of “smaller” scripts that I have, both the music-related one and the other “multiple scripts” repo. Just looking at the difference in the README, it previously was just scattered notes about the scripts, but now it actually documents what’s there, how to use it, and how it works. The README has been expanded to explain actual usage, options, and configuration rather than merely saying what each script is for. This is exactly the sort of thing where being predictable, repetitive, and meh at writing is actually perfect. I don’t want people to spend time deciphering where my documentation is correct and where it’s outdated; I deal with that enough already. And if they can use my utilities, they don’t have to use AI to solve the problem themselves either.
That is the important part.
The problem I wrote these scripts to solve is the type of situation where AI gets used frivolously and needlessly so.
Making user avatars and cleaning up old ones is something that there’s a demand for. I’m basing that on judging by how many attempts there have been by other people … and how quickly they’ve become unmaintained or unworkable. There’s demand, but not a lot, and the technical problems have been more of an issue than anything else. Particularly if you are PC-first instead of mobile-first, and Linux first… well, I’m not the only person, but it’s not been worth anyone’s time or money to sit down and to make something that actually does the job I need it to do.
And you may be thinking of some other service or software you’ve heard about, these days there are plenty of advertised solutions for contact sync and generation, they either explicitly use AI, don’t work for my operating system (or at all any longer), require a subscription of some kind, are ripping off other sites advertising the same service, or any combination of the above.
Search for “make user avatar” and fully half the hits (or more) are explicitly promoting that they use AI, and a good portion of the remaining ones also use them, but just don’t promote it. And unless they’re pitched to developers (in which case it’s just “make a bunch of random ones”), the implied flow for the user is “Make an avatar for this person for my contact list.” Or maybe, “Find an avatar online for this person, and if they don’t have one, then generate one.”
Unless the AI/LLM already has a stored skill/memory/instructions on how to do that, it’ll figure out that whole process… and then repeat figuring it out each time. You’ve probably seen this behavior, particularly if you’ve worked with it in programming. That AI/LLM behavior is useful for “figure out an unfamiliar or changing situation”. This is absolutely bonkers for how we actually work in real life, particularly when it comes to computers.
Because VCards are a standard, and the APIs for Libravatar and Gravitar are standards, and since DiceBear will work with any string input, we don’t need to validate anything. Imagemagick is free, offline, and able to check photo size, color variations, and horizontal and vertical symmetry.
And as long as you have your contacts in the VCard standard, these scripts will almost certainly work right out of the box for anyone using Debian, Ubuntu, Mint, and MX Linux. Ensure the equivalent packages and dependencies are installed for Arch, Gentoo, and Fedora, and you should be working. Even OSX+Homebrew (with tweaking) could work, and Windows+WSL is essentially compatible with Linux utilities (as I understand it).
And nobody who uses these scripts will need to use AI to fix their contact icons.
Oh, sure, there are definitely ways to use facial recognition tech and AI to find the low-quality avatars. Instead of having the very computationally heavy AI/LLM solve the same problem over and over, a single problem got solved: How can we use the tools we have to detect the low-quality avatars without using AI?
I had no idea of where to start, except that I had a lot of examples of “good” and “bad” avatars. It turned out there were a couple of common characteristics that were good correlations: A small range of colors, small size in pixels, and a high degree of symmetry. Finding out what data was able to be extracted and identifying the correlations was wholly the work of an LLM. I knew that Imagemagick would be involved, but figuring out what the exact commands and switches should be was also largely determined by an LLM.
Imagemagick is a powerful software suite, with many many fiddly bits, and has been around for quite some time with some major version changes. Its official documentation is correspondingly complex, and unofficial documentation might be easier to understand, but may or may not be accurate now. And while it is fully capable of testing the symmetry of an image, that’s not what it is for.
I knew exactly what needed to be done for each of those two tasks, but not exactly how. Both were also one-time tasks, and the result of those tasks was a bit of static (“deterministic” if you want to sound cool) code that solves the problem with an unexpected, clever application of a tool we already had.
Likewise, DiceBear itself is not an AI image generator. It is a deterministic, procedural avatar generator: it takes a seed such as a name or email address, feeds that into a pseudorandom selection process, and assembles an avatar from predefined SVG components supplied by the chosen style. The same seed and style produce the same avatar.
A surprising amount of what is now being marketed as reasons to use AI/LLMs were already things we could do with regular automation tools and scripting. We’ve had email templates for decades. Text expansion utilities. Getting your news without having to tell Google or Alexa or or or where to pull it from. And arguably, those tools are far better. And yet we literally have people trying to get LLMs to recreate a perfectly good OS on the fly each time.
There are things that AI/LLMs are really good at, sure. When information is unclear, spread across multiple sources, or not in standardized formats, AI/LLMs are really great at cleaning it up and standardizing data. A generative model is good at putting together information on how to use imagemagick to identify bad avatars, at taking an text export of my calendar appointments and turning it into a text paragraph for a text-to-speech engine to read aloud. The entries are unpredictable in volume, amount of detail, and so on; parsing that and turning it into regular text is exactly where AI/LLM excels. But that’s also where I switch back away from the AI/LLM use. I use Piper instead of diffusion/generative models to have it say the result. Piper still uses machine learning and neural networks — it isn’t non-AI in a super literal sense — but it’s a small, specialized, locally runnable speech-synthesis system, which is very different in terms of resources from sending it to a large cloud AI service.
Just some thought and existing tools can reduce or eliminate the need to use AI/LLMs at all.
Let’s say you have specific tasks on days that you work that must happen at certain times of day, but only happen on days you work, and what days you work changes week-by-week. Almost seems like it’s really complex… but it’s not. Instead of cross checking calendars and conditions and days of the week and and and, you make the trigger something that happens as part of going to your job. Perhaps its opening the work profile of your browser. Your phone connects to the work wifi. That triggers a script that adds the calendar events.
I’ve done something exactly like that; while I wrote my script without an AI’s help, I’d think that having it solve the problem once by writing the script for you is better than having it do all the work over and over again. The idea is to use AI/LLMs as a tool to create the appropriate tool from what already exists. Even if you need to invoke an LLM as part of the process — such as with my independent research project — it’s only used where it’s the right (or necessary) tool for the job.
All aspects of our society have positive and negative effects; it’s a matter of whether there’s more of one or another. Automobiles produce pollution and burn fossil fuels; they also get sick people to the doctor and musicians to theaters. But it’s better to have a car with better mileage and that puts out less pollution. It’s better still to not drive to your next door neighbor’s house, or to take the bus when you can.
I do think most of the problems with AI/LLMs are largely driven by the human decisions of those who own them. At the same time, changing the way we look at and use the tools can help let them be useful while reducing the harms to ourselves and the planet.
PS: What About Generative AI For Creative Stuff?While I definitely have used AI/LLMs to both find bugs in code and create documentation (thus making what I’ve done more useable to others). I have even gone into vibe-coded territory at times, though at levels where I could still look at the code and figure out what it was doing and do step-by-step testing to check everything.
I’ve barely mentioned generating fiction, images, videos, or audio.
That’s because even where I had used it previously, I’ve pretty much stopped. (This isn’t obfuscation but me erring on the side of being extremely literal.)
There are legit ethical concerns about the training data, compensating artists for stolen work, and concerns about putting artists out of work. And it’s clear from the numerous lawsuits, the tool’s output (as well as the occasional pounding on a web server where they shoudn’t be), that the people running these companies are still scraping training data they really should not be.
But even if you didn’t care about that, there’s practical reasons. My impressions of the shallow impressiveness have only deepened despite occasional flashy moments. And worst, using AI generated material can instantly pull readers (or players, or viewers) away from what you are actually trying to achieve. Instead of helping immersion, it breaks it. It is Ed Sheeran’s face reminding you that Westeros isn’t real. It is the technobabble so bad it draws attention to itself.
At this point, using AI generated images, art, video, and text are counterproductive.
Yes, of course there are citations for that last bit.
Rapp et al. “How do people experience the images created by generative artificial intelligence? An exploration of people’s perceptions, appraisals, and emotions related to a Gen-AI text-to-image model and its creations.” International Journal of Human-Computer Studies, Volume 193, 2025, 103375, ISSN 1071-5819, https://doi.org/10.1016/j.ijhcs.2024.103375.
Belanche et al. “Customer reactions to generative AI vs. real images in high-involvement and hedonic services.” International Journal of Information Management, Volume 85, 2025, 102954, ISSN 0268-4012, https://doi.org/10.1016/j.ijinfomgt.2025.102954.
Featured Image by Clker-Free-Vector-Images from Pixabay