246 comments

[ 2.9 ms ] story [ 276 ms ] thread
Interesting, but has relatively low character limit.

Can’t even fit the “Tears in Rain” soliloquy from Blade Runner :/

I think the legibility slider can go quite a bit lower. None of the models are anywhere close to real world illegibility.
I was going to comment the same thing, but style 6 at min legibility is almost as bad as my handwriting.
Needs a "doctor" mode.
Isn't it interesting that regardless of the culture, every nation seems to have "doctor" mode writing?

I wonder how it comes to be.

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.
it can't do accents
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:

https://qph.cf2.quoracdn.net/main-qimg-5d1b0e1d28c12813e1255...

or here especially 1st and 3rd line https://d50-a.sdn.cz/d_50/c_img_E_C/3VfFjd.jpeg

Then we can talk about REALISTIC handwriting.

> 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.

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.
> There is no such thing as "normal cursive".

http://enwp.org/Teaching_script

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.

Realistic for me would be including small ink pools, skips, smudges, crossed out corrections, and so on.
It has issues with capital letters. One at the beginning of a word works correctly. Mor than one and it falls apart, i.e. III
Ooh, thats why I thought upper-case A was broken! Apparently only when you write an all-uppercase word.
would be cool if there was an API
From a previous comment, it's an open source project!

https://github.com/sjvasquez/handwriting-synthesis

Well, the source code is available, but as there is no license you can't really consider it open-source.
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.
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.
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.

(comment deleted)
Apart from the signature generation, here is another project that does the false-scanning and signature pasting : https://gitlab.com/edouardklein/falsisign
You might as well make a scan of your actual signature and make the generator overlay the image instead.
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.

MacOS Preview app has a handy feature to add a signature via the trackpad or camera and then just paste it into any PDF.
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.
Would be awesome if you can download it as OTF/TTF.
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.
If anyone's interested, I think this is the github url of this project (had to dig a bit since it's not mentioned in the page): https://github.com/sjvasquez/handwriting-synthesis
Wow, it's 5 years old.
And still the style does not go to 11.
And it has a rick-roll in the README.
Hmm, it looks like some ASCII characters are missing from the hard-coded alphabet here: https://github.com/sjvasquez/handwriting-synthesis/blob/mast...

alphabet = [ '\x00', ' ', '!', '"', '#', "'", '(', ')', ',', '-', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'Y', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ]

That seems to explain why it fails on capital X/Q and doesn't fail on lowercase x/q.

Thank you for the Github url. I thought this was another website like the dafont.com and is animating the text!!
Great! Can someone get it to run inside the browser using WASM?
This is perfect for those ransom letters I send out. I no longer need to search around for newspapers and am going to save a fortune on sticky tape!
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.
Fortunately, it works without an Internet connection!
Just don't print it at home! Your printer is probably a snitch.
Or you can buy a plotter.
It reminds me of Turry...
Awesome, but fails with accents etc.

A case for polish: „Zażółć gęślą jaźń” - fails in many gunny ways.

I also tried emojis - of course it failed, but now I’m super curious how would hand written emojis look like :D

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.

Same with languages like Portuguese and French, it did not got any of them right.
> A case for polish

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?

Even ASCII characters like $&@ don’t work.
It generates different writing even if you choose the same style.
Should it worry me that the legibility slider cranked all the way to zero is still more legible than my actual handwriting?
Are you a doctor?
to my parents' major disappointment - no :-(
I first read that as "to my patients' major disappointment, no" and chuckled :-)
(comment deleted)
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...

Although correlated, I'm less worried about the doctors than all the prescription errors which were said to kill many people.
Just let the computer do the handwriting and you’ll be fine.
For accuracy, it needs negative legibility settings. Anyone who's been in a sprint retro with hand written action points knows this.
breaks regularly on 'hi' , the "i" is usually not dotted and if the 'h' is connected to the 'i' it usually doesn't read right
Non-english alphabets unreadable even with maximum legibility setting.
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.

1 - https://arxiv.org/pdf/1308.0850.pdf

(comment deleted)
It seems to me it only supports ASCII. It breaks on cyrillic, accented letters, less common punctuation marks, even some random latin letters.

It's a very cool prototype but missing a LOT.

Gets confused with multiple exclamation or interrogation signs in a row; seems to forget about the bottom dots.