Neat! Try "XxXxXxXxXx", max speed/legibility/width, style 2. The results are bonkers. It's just loops and scribbles. Interestingly, if you write your X's from top-right to bottom-left, top-left to bottom-right order, you can sort of see this in action. Grab a sheet of paper and try to write "xxxxxxxxx" really fast. You will see that loops are extremely common. I think this might be a coincidence, but it's possible it sees the kerning of two x's as a loop, then gets caught up in that false state of drawing loops.
Cranking up the "legibility" I see plenty of perfectly respectable "x"s. Are you sure this is "not enough training data" rather than "actually, people writing quickly write pretty bad 'x's"?
[EDITED to add:] Ah, oops, I see. You were talking specifically about _capital_ X. You are right and I was wrong: the model produces disastrous capital Xs even at high legibility settings.
i recommend trying the phrase "sphinx of black quartz, judge my vow!" on style 6, with legibility set to maximum. sometimes it looks roughly right, sometimes it opens with "sphnnneoooeoeoeoeoevorneroerof black quartz"
I like that phrase. On style 2 with high legibility (~75% to the right), max speed, and min width I ran it a couple times with good success then it looped off the screen for the next few runs.
The same settings but with min speed got caught at the z, creating what looked like repeating waves then a few letters that I couldn't place from the phrase.
Also amusing are the loops that get the tops cropped even though other letters extend higher.
I had it rewriting in style 6 several times "consider the lobster" without changing any settings, to see how random it was. After the fourth time it spat out "consider the lobsteoeororororo"
Doesn't handle accents either haha. My first name has an "é", it shows up somewhere between a straight up "t" (funny that it's the same letter as your "x") or some garbled mess.
Common punctuation wasn't particularly common in the training set either: exclamations marks lack dots except style 6 where it is at the top (some Spanish in the training set? Or misclassified "i"s?), and [deity] knows what style 9 is doing with them. Didn't dare try an interrobang :)
6ix9ine puts the 9 as a G and the x is all sortsa fun variations. Sometimes it’s a lowercase t, sometimes it’s a bunch of loops, and sometimes it’s two disconnected slashes.
For fun: max speed, max legibility, style 2, sentence "My first name is: bla bla bla bla bla bla bla bla", stroke width doesn't matter.
It may take a few tries but at some point, you may get some weird results (about 1/4 time for me). It may happen with other settings, but these work well for me.
I can reproduce this very close to 100% of the time (on some of the styles) with a specific string - my string contains an apostrophe & ends with "III" suffix.
It also reproduces, but only some percentage of the time & on some styles, with only the string "III" (no quotes).
Neural nets often fail with (repetitive) gibberish output when the input is too different from the training data. This model appears to take in the entire text input at once or look ahead at the next input letters, so the unusual "bla bla" at the end can mess up outputs near the beginning.
The "bla bla" actually doesn't do much, that's the "My first" that triggers it most of the time. I only added the "bla bla" in the end to make the line longer because it looks better that way, but just writing "My first" or even "My f" is enough.
It is described as "Realistic handwriting generator. Convert text to handwriting using an in-browser recurrent neural network", so, unlike GPT, it is not a transformer and it is small, so it most likely doesn't take the entire text input as once. Most likely, it simply overshoots the previous stroke and decides that a loop is the most appropriate way to continue, then it overshoots that loop, and again, and again, until by chance it stops overshooting and proceeds to the rest of the text. Cursive style like #2, the need for precise strokes (high legibility) and specific letter transitions seem to exacerbate the problem.
It correctly connects letters and it can do Czech and Slovak accents. It is based on a Metafont source (to be used in TeX) from Petr Olšák, I wrote Python code that reproduces Metafont's Bezier curves algorithm, generates curves as SVG, then calls Inkscape to convert the curve to its boundary, imports back into Python from SVG and then it generates OTF curves and the final font.
Indeed! The above cursive is a Czechoslovakian style from 1990s (I think it hasn't changed much since then), and most European countries have quite similar cursive. In the United States the cursive is actually similar also, but a few letters are different, notably: z, r, t and most uppercase letters. My kids learn it at public schools here in the U.S., but it is secondary after print style and assignments are not accepted in cursive... (I am sure it varies from school to school though.)
Please go ahead, that would be great. The output of this script: https://github.com/certik/slabikar-otf/blob/dce9fc9e575f7d6e... creates a single line SVG. The other scripts then feed it to Inkscape and read it back as outline, so you would skip this step. You can then use this script: https://github.com/certik/slabikar-otf/blob/dce9fc9e575f7d6e... to convert to glif and the rest of the pipeline to build the font. I think I implemented single line fonts in glif.py, but if not, it shouldn't be hard to implement. If you are interested in collaborating on this, please let me know, we can add it as another job at the CI to test this mode.
Do you have a plotter? Send some videos and photos once you get it working!
Combine this with ChatGPT and a Pen Plotter and you can offer heartfelt hand-written letters as a service. (That are neither handwritten, nor heartfelt, but people won't notice, or care.)
I think all of the car dealers I've dealt with the past decade are doing something like this. I get "handwritten" notes from them a few times a year telling me the market is hot for my 5 year old Subaru and I'd be a fool not to trade it in.
I don't know if it's a machine writing the notes or if that's what salespeople do when they aren't busy.
I work for a company that writes a lot of the fundamental technology for car dealers. In most cases you probably are getting actual handwritten notes from salespeople. They’ll absolutely put that minimal effort into lead generation.
Compared to the hoops salespeople jump through on a daily basis to chase down anything that faintly smells like a lead, scribbling notes on mailings is low effort indeed.
Japanese companies, such as Honda, have a history of using personal relationships and direct communication to get their products off the ground, such as in the case of Mr. Honda writing to thousands of dealers to ask them to stock his new invention, the bike with an engine, in order to help his company and the Japanese economy to recover.
Do you own a 5 year old Subaru? The universe thinks I own a 2011 Dodge Durango. Never owned a 2011. Never owned a Dodge. Nevertheless I get about one junk mailing a week asserting that I do.
All are addressed to the same esoteric spelling of my given name (that I do not use) and my actual correctly spelled family name.
Most likely mass printed for targeted mailing with a handwriting style font. I remember getting something similar in the mail written in what appeared to be blue ink from a ballpoint pen. Only to find out my wife got an identical piece of ad mail , just with her name at the top.
I noticed some similar letters several years ago and had a pretty negative response once I figured it out. But these might be enough better I wouldn't notice unless of course I see another one like you did.
Most people, yes. A few will definitely notice and care. Faking this stuff is the fast way to get on my shit list, though I realize I'm in a minority here. I am very pro AI in general, but I am extremely anti-deception. If you send me a 'hand-written note' that really wasn't, why would I trust you about anything else?
I'd generally agree. I personally despise gifts that I receive just because the opposite party felt obligated to give me something. Even if I actively express that my wish is to not receive gifts this is often just ignored because gift giving is so deeply ingrained into our society.
However the more I think about it, I don't think that I'd be opposed to receive a card that was written with the help of an AI. Surely it's much more thoughtful of someone to input a couple of keywords that they associate with me and then pick the best one from a few generated cards, than a generic card with an even more generic phrase and picture on it.
Feels much less like deception to me and more like assisted writing.
I always wondered if pharmacists had any specific training in the terrible handwriting doctors put on prescriptions, or if they all just figure it out in their first year.
> I always wondered if pharmacists had any specific training in the terrible handwriting doctors put on prescriptions
One day my local pharmacist was in a chatty mood whilst filling my request and one topic that came up was doctor's handwriting.
The answer is yes, they do (did ?) receive training in handwriting recognition.
Basically it involves learning to recognise common abbreviations and mostly being very familiar with drug names and dosing.
As the pharmacist said, when he received his training it was "easy" because the formulary was "somewhat shorter" than it is today. As a result he said his junior trainees struggle and frequently come to him guidance until they've had sufficient exposure.
However with things moving to electronic prescriptions the days of deciphering will be relic of the past for many pharmacists.
This reminded me, I once attended a lecture by a pharmacist who got interested in handwriting and showed how different conditions and medications might manifest in customers' handwriting.
Looking at the samples, it was pretty fascinating.
Since he undoubtedly read a lot of doctors' writing too, and since I personally know a doctor who abused their access to medication, I did wonder what questions this pharmacist would've had about local doctors...
And it definitely feels like something the creator could (and should?) make money off of.
Limit free usage to medium-resolution bitmaps and a subset of styles, but make paid downloads available for high-resolution SVG's and a wider variety of styles.
I can also imagine there's a market for ersatz "handwritten notes" from companies that genuinely appear to be handwritten, rather than using a handwriting font -- to license the software itself as some kind of mail-merge plugin or something. Combine it with an autopen or something, and nobody could tell the difference.
Yes, this is already A Thing in marketing, though as you say it currently uses fonts & printing. I hate it and am biased negatively against any company that does this, because their marketing materials lied o me by pretending to be a personal communication, to get my attention for their mass-produced marketing message.
And it definitely feels like something the creator could (and should?) make money off of.
No way! It should be reverse-engineered and reproduced so that nobody can make money by gatekeeping it. If we can automate the production of handwriting, we must be able to automate the production of automated handwriting generators.
I've had a project idea similar to this in the backlog for years: personalized signature generator that can be used to deal with dinosaurs that still want printed, scanned and signed documents.
Basically I want to take a pdf, turn it into fake scan image (add noise, some inkjet smear lines, random skew etc procedurally), then generate signature image to paste over that. Zero dead trees and screaming at printers involved.
These fake-scanner pdf generators always use a huge skew. A tiny (random) bit of skewing makes it seem more genuine, but using the same exact large rotation puts it in an uncanny valley.
It is trivially recognizable in PDF viewers like Adobe Reader that a signature image was pasted in (the image rectangle around the signature highlights), and can therefore be rejected as not being a genuine signature, unless you turn the whole page into an image to make it look like a scan.
Make a very high-quality noise-free image of your signature, with a transparent background. Drop it onto an equally high-quality PDF and skew it a bit. Add some toner noise to the whole image and skew the image a small bit.
I think you can make it look decent. Haven't tried it though.
Just yesterday I scanned my signature and added it to Adobe Reader. It even automatically made it transparent in a correct way. It didn’t add noise though.
I scanned my signature at high resolution from blank white paper, cleaned it up a little with Paint.net, and made the white areas transparent. Pasting that into documents has saved me a lot of hassle.
Legally I'm pretty sure you could also just draw an X on there and you'd be fine.
So now I just need to go ask this startup to see their logs. I'll get your IP address in no time. Maybe I'll need a warrant. But I'm sure these guys will just be very nice and send me their logs on an ongoing basis.
I run it few times and some in some variants algorithm just gives up and produces some noodles similar to "szlaczki" - the patterns kids train before starting hand writing. Definitely the issue of diacritical mark presence - maybe the input should pick the closest "clean" Latin letter before algorithm becomes aware of accents?
It would probably look a lot like handwritten kanji.
Asking various stable diffusion implementations, it looks like it agrees with me at least a little. When anything close to what I want is generated it tends to actually contain kanji like fire and life.
I think a lot about how the written English language has been altered by technology. Latin majuscule letterforms were designed, AFAICT, to be easy to chisel into stone. Miniscule letterforms were later invented because they were faster to write, enabling monks to copy manuscripts more quickly. Printing press manufacturers saved money by getting rid of letters that could be replaced by combining others (the thorn), alternative letterforms (long S), and rejecting ligatures. Later, both typewriters/teletypes and low-resolution early computer displays would force English letterforms to be further simplified.
To tell the truth, mostly I'm just envious of all the beautiful calligraphic scripts that are standard in other languages, whereas with English it seems we're stuck with sterile Helvetica clones. Maybe someday we can re-beautify everyday English.
It gets even more intricate! Until the 15th century or so, there were dozens of different styles of Latin script optimised for slightly different writing technologies [0], some so different to what we’ve now converged on that I hesitate to call them the same script. Our current handwritten lowercase letters developed around fountain pens and quills — something I realised when I started using fountain pens and realised that lowercase writing suddenly became much more natural. On the other hand, our printed lowercase letters have changed little since Charlemagne standardised his miniscule script for maximum legibility with a broad-edged nib. Meanwhile, in Germany, blackletter styles developed for fast writing with the same nib; this eventually ended up as Sütterlin [1], which looks quite different to the script we’re currently using. In England blackletter developed into ‘secretary hand’ instead [2], which again looks quite different. And of course there’s more! [0] is the best overview I’ve found.
(Thinking about this I do often wonder what a form of handwriting optimised for the ballpoint pen would look like… probably quite different to our current handwriting styles!)
I suspect its less to do with actual, objective legibility and more to do with patient anxiety. The things that doctors (and pharmacists, etc) hand-write tend to be personally important.
As other people have mentioned, this seems pretty limited and does look like it struggles a lot with "uncommon" situations. Doesn't look like it handles stuff like line wrapping either, although maybe that could be a separate step.
Still, incredibly fun to play with, and something I could easily imagine being useful at least for small projects if it was generalized just a little bit more and trained on more diverse datasets. Really cool project.
I really like that you can play with speed using (roughly) the same style/legibility settings; it would be interesting to be able to simulate handwriting for a single "character" and subtly convey information visually about what state of mind the person was in whenever they were writing.
This is indeed a very cool demo, and runs fully client side. I have been trying to find a way to add this to my project for a while which is a client side static website. As pointed out in other comments, this is open source: https://github.com/sjvasquez/handwriting-synthesis
It is still far, far from realistic cursive writing(especially old documents). But it's a good starting point if you want synthetic training data for writing your own handwritten text recognition NNs (specially for less common languages). It's based on 10 fonts only. I saw papers that had systems using 5000 different fonts to generate synthetic handwritten training data.
I'm right handed, only 6 & 7 styles looked to have a right-handed slant.
Perhaps a slant (skew) slider would be a nice touch.
Also, none of the styles stroke their dots (dotted "i", etc.). I know it might be derisively called "cheerleader style" (but it's the way I dot my i's to give the dot more weight).
I have the feeling that the amount of programmers whose minimum acceptable standard for code is on the level of "garbage in, garbage out" is on the rise. I condemn this development, that's a lack of role models who can transmit the values of culture and discipline.
If I had written that software, I would have made an effort to support the complete Latin script, or at the very least shown an error or a warning for unsupported letters.
Looks like it's based on this paper [1]. It's a recurrent neural network trained on online handwriting data. It means you record how the position of the tip of the pen changes as you write. The training data comes from the IAM On-Line Handwriting Database which has only handwritten English text.
If you want to support a complete Latin script, you would have to generate a lot of training data yourself, preferably in multiple languages. Quite the effort indeed.
As another user pointed out, it can't correctly write accented vowels. Curiously, it writes them quite differently if I add spaces between them, like it was attempting to translate the appearance of characters rather than picking them from a ascii table.
Well, there are lots of different handwritings. Not everyone writes cursive (especially in the US it seems to be very rare). My own handwriting is something like a hybrid between cursive and print with a few contextual ligatures thrown in.
This is a very old project glad to see it get the credit it needs.
One interesting thing is if you show someone this for a random sentence and ask them want do they think. They always say how did it copy my writing. Everyone thinks it looks like their own writing. Likely because its the average of all peoples writing. Try it out
My very first test was: how similar is each instance of the same character? Because they always just fake handwriting and duplicate it and you can instantly tell it's just a font or whatnot. Not this one. Not only are they unique each time, but they retain the "style." Well done.
This is neat. I'd like to hear a bit about how it works.
There is a similar paid API that does something like this https://handwriting.io (seems like they are down now though) I used to use it for print projects back in the day.
This is almost certainly an RNN, likely from the RNN-handwriting bit of work a number of years ago. I love it quite a lot, however. I believe that it has aged well into the present day. It is interesting how some algorithms do, and how some do not, these days.
This is excellent. Can someone knowledgeable weigh in on what it would take to make an API out of something like this so one could say integrate this into a document/image/presentation generator. Or for a simpler usecae - personalized greeting card generator.
It would be great to use this for complex latex equations.
Often a hand-writing feel makes youtube math explainers and lectures much more absorbing.
But, at the same time, handwriting makes videos a pain to edit to correct the mistakes that all math lectures longer than a few minutes inevitably have.
This would have been so awesome to have something like this in my high school years in Eastern Europe, where teachers ask for you to write essays by hand instead of typing them. The font is similar to my handwriting, but fails on letters with accents.
I wrote Namaste, and the N for that looked more like an R. I tried again with Normalization and it produced correct letters. Then I wrote namaste and it wrote it correctly as well. Wonder why it doesn't like "N" in Namaste. :D
This would have been so awesome to have in my Eastern European high school, where you're required to write essays by hand instead of typing them. The font it generates is similar to my handwriting but fails hard on accented letters though.
Looks lovely. Are you planning to add diacritics or Latin ext characters, (ä, ł, õ)? I'm curious how an animation with them would look as normally I'd apply them either after each word or after a bigger chunk of a word.
In order to be "realistic" it introduces too much variation between the alphabets; a real handwriting has generally less drastic variations and the degree of variation also varies from alphabet to alphabet.
"real" handwriting also gets tired so it becomes progressively worse. unless the person writes a lot. which is why you see people who write left-to-write on a blank page compress and slant upward as they go.
Almost what I want. Is the generated written unique? I would love the chance of collision akin to UUIDv4. So I can track similar but unique signature on digital documents.
I used something similar a year ago to write out a ton of Xmas cards using my 3D printer. It was really cool, but probably would have been faster by hand.
For something called calligrapher I would have expected it to be able to do Japanese, but it just produces unreadable garbage when non-English is used.
How would that be able to work? - as it doesn't write the same character exactly the same twice, with both random variation and adapting the letters either side.
I get some pretty wild output from symbols in general. For example try something like "@#$_*" and it's hard to recognize anything, especially run-to-run. Very neat app in any case, but I will admit I'm a bit memorized by what happens to symbols.
A large number of handwriting synthesis demos are derivations of/inspired by Alex Graves's paper "Generating Sequences With Recurrent Neural Networks". Alex's code is available under GPL-3.0 here, https://sourceforge.net/projects/rnnl/. One could also port the techniques described in the paper, https://arxiv.org/abs/1308.0850 using any modern machine learning framework.
The UI is beautiful because it gets out of the way
The fact that you have a built in SVG export is chefs kiss
My only suggestion re the export is you should have it save as .svg, on my mac / chrome it just saved as an extension-less file.
Is there any way it could output line paths instead of shapes? I would love to be able to use this with my pen plotter but because of the output it effectively does tiny traces around each letter instead of natural strokes like a person does
That's not really realistic, it can't even do normal cursive handwriting with first capital letter joined, I dunno anyone who writes like any of those 10 styles, maybe they are common in US, but certainly not in this part of Europe.
Get back to me when it will knows at least something like this:
> That's not really realistic, it can't even do normal cursive handwriting
There is no such thing as "normal cursive". Cursive as a general style is primarily defined by joined characters, which this generator definitely does, in contrast to print writing which has separated characters.
Even formal cursive writing systems vary wildly in style and construction, and I'd venture a guess that vast majority of people do in practice have pretty sloppy style.
There exist handwriting styles that have been standardised by their national ministry of education or similar, and millions of school children each year learn it. It is true that quite soon the individual's styles diverge from the normal form.
All styles I tried have first capitalized letter separated (not joined as it should be properly) and written in print writing, that's not really cursive by my standards.
Let me tell you: the training data did not contain that many X to begin with :D
The Xs at best look like Ts, at worst like malformed Os.
Always funny to find the blind spots of some piece of tech.