51 3
Sign in to rate

Kanji Colorizer (stroke order diagrams)

51.06MB. Updated 2018-10-29. Supports both Anki 2.0.x and 2.1.x.

This item is large, and may take some time to download.


The Kanji Colorizer addon automatically adds colored stroke order diagrams to your kanji cards. They are stored as media, so they continue to work even when you're reviewing on a platform such as ankiweb where you don't have the addon installed. Usage: Add a "Diagram" field to a model with "Japanese" in the name and a field named "Kanji". When you finish editing the kanji field, a colored stroke order diagram will be added to the Diagram field in the same way that the Japanese support plugin adds readings. If the Kanji field contains multiple characters, the add-on will only generate diagrams for the kanji; if it is a single character it will generate a diagram if it is kana as well. To add diagrams to all such fields, or regenerate them with new settings, use the "Kanji Colorizer: (re)generate all" option in the tools menu. The development site for this addon is at https://github.com/cayennes/kanji-colorize . If you have any bug reports or feature requests, use the issue tracker there or email me at cayennes@gmail.com. I do not get a notification when you post a comment on this page. UPDATES: 10/28/18: Support anki 2.1 (thanks j-kramer!) and use new config system 12/23/17: Update KanjiVG data 12/22/17: Fix bug that would lock up anki when editing kanji cards in some conditions. Thanks to Quinnlet for reporting and alexpizarroj for finding the problematic code. 10/11/14: Kana support added 10/11/14: Newer kanjivg version, fix from LucasEasedUp for an exception when closing an empty add card form 4/15/14: Latest kanjivg version 12/7/13: Ignore invalid characters (such as Chinese characters that don't exist in Japanese) instead of throwing error. 10/27/13: Fix for issue where diagrams were no longer generated after upgrading anki 5/9/13: Contribution from shufps: option to create colored groups instead of colored/numbered strokes (that was a while ago but I broke it before uploading it; now I've fixed it) 4/9/13: updated stroke order information from kanjivg 3/31/13: Fix for the "No module named colorsys" errors that some people were seeing; also ospalh's fix for number coloring (no longer inappropriately bolded)


As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

To download this add-on, please copy and paste the following code into the desktop program:


If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

Other Anki 2.0.x Add-Ons Other Anki 2.1.x Add-Ons Ask a Question


on 1568667693
I love this. Thank's a lot.
Only drawback, it takes up a lot of space.
So here's how I deal with that:
First, we're going to do the trick mentioned before me to get the stroke order diagrams to be displayed a bit smaller.
THEN, we're going to hide them entirely and add a button with which we can display / hide the diagrams:

<button onclick="showHideStrokeOrder()">Stroke Order</button>
<center><div id='strokeOrder' style='width:120px; height:120px; border-style:solid; border-color:white;display:none'>{{Diagram}}</div></center>

function showHideStrokeOrder() {
var x = document.getElementById("strokeOrder");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
on 1566185534
on 1564422858
Essential add-on for any kanji deck.
on 1563553560
Works perfectly! Without it my personal Kanji deck wouldn't be half as effective. Essential for being confident in my stroke order.
on 1562106812
Works perfectly!
on 1560781940
on 1559575770
Great add on! If you're having trouble following instructions like me...The plugin wants Note Type to contain "Japanese", not Card Type or Deck name. To rename the Note Type, go to Decks → Browse → Add → [click field next to Type] → Manage → Rename → [select relevant type] → Rename. Then make sure you have at least 2 fields, one named Kanji and one named Diagram, and this plugin installed. Then go to Tools->look through your add-ons to find Regenerate Kanji strokes.
on 1556585429
Is a excelent addon.
on 1556501543
it's prety useful
on 1553610387
Learning kanji is a lot more rewarding now, thank you!

This is how I force the stroke order diagram to a smaller size on my screen. (The smaller the rectangle the smaller the diagram - probably not the most elegant method, but works for me.)

<center><div id='rectangle' style='width:120px; height:120px; border-style:solid; border-color:white'>{{Diagram}}</div></center>
on 1552184440
Saved me editing all my cards. Well chuffed. Thanks !
on 1547232456
Just perfect.
on 1544882669
I can't download it too
on 1544498990
I can not download
on 1543172709
Perfect! Thank you so much, you saved me from editing 23000 cards. Especially that you thought about allowing white as a color setting. Very nice!
on 1542842133
How to resize stroke order diagrams to small size
on 1533276519
Works great. The diagrams are great and easy to follow.
on 1526515200
Amazing add-on and very very valuable. Thank you very much for your hard work.

I seem to have a problem, however. I use this add-on for my RTK deck and it seems to randomly create diagrams for some of the Kanji and not for others. The ones left alone are not necessarily very difficult or rare Kanji. For example, 池 is left un-diagramed.

Maybe because RTK contains some rarer Kanjis the code encounters one of them mid-way and decides to stop rather than just ignoring it?
on 1523145600
Well done
on 1516147200
Absolutely fantastic. Applied to my deck of 3000+ kanji and auto-filled the diagrams per the instructions. For the last 1000 kanji I do it auto-fills the field as well. Extremely handy when reviewing to have the stroke order right there, and even more handy to not have to manually draw up the stroke order for each one.

Whoever spent all this time on this, THANK YOU, it's working wonders.
on 1513987200
Bug from 2014 = terminated.
on 1500508800
Still great but bug from 2014 is still there

The bug reported below in 2014 that causes error messages and "Waiting for editing to finish/Resume Now" over and over, is still there. Here is the full error message. The way to cause this error is to start studying your card deck, and get to a card containing a colorized kanji, then clicking Edit and then Done and it will happen.

An error occurred. It may have been caused by a harmless bug,
or your deck may have a problem.
To confirm it's not a problem with your deck, please run Tools > Check Database.
If that doesn't fix the problem, please copy the following
into a bug report:
Traceback (most recent call last):
File "aqt/progress.pyc", line 69, in handler
File "aqt/editor.pyc", line 468, in onUpdate
File "aqt/editor.pyc", line 540, in loadNote
AttributeError: 'NoneType' object has no attribute 'media'
on 1499385600
I love it!

It's the best addon for kanji learners! Thank you sooooo much!
on 1496102400
Stroke direction, solution to diagrams not showing up

It took me a long time to realize that the stroke numbers are located at the start of the stroke, NOT where they fit, allowing you to figure out the stroke direction. I bet I'm not the only one.

Diagrams don't show up in the browser? This worked for me:
Go to addons>kanji_colorizer>edit
find <img src="%s"> in the code near the bottom
add &nbsp; right in front of it so it becomes &nbsp;<img src="%s">
leave rest untouched
re-generate diagrams
on 1488758400
How to update the KanjiVG dataset

It's been almost 2.5 years since this plugin's KanjiVG dataset was updated, so here's how to easily update it.

1. Download https://github.com/KanjiVG/kanjivg/archive/master.zip
2. Replace your installation's [User]/Documents/Anki/addons/kanjicolorizer/data/kanjivg with the archive's kanjivg-master/kanji (while Anki is closed ofc)
3. Regenerate your diagrams as necessary.

That last step caused the plugin to generate thousands of new '* (1).svg' files for me rather than just overwrite the old ones, so if you have a separate field for the diagrams, it's probably better to wipe it (using a regular expression like (?s).* in S&R explained below) before regenerating.

If it still happens and you want it clean:
1. Use a renamer like krename ("overwrite existing" toggled in its 2nd tab, and just " (1)" in a Search&Replace entry on the 4th one) on the affected files in Anki/Main/collection.media
2. Select all cards with diagrams on them in Anki's card browser
3. Open Search&Replace (C-Alt-F), search for eg. " (1).svg" to be replaced with ".svg" and select the appropriate field(s).

Anyway, it's worthwhile to use Anki's "Tools → Check media" afterward.
on 1435363200
The best Heisig companion out there

The best supply to a Heisig TRK deck I've ever stumbled upon. A must-have for anyone who plans on studying the kanji seriously. Aids the whole of the mnemonic process greatly.
on 1419465600

I have been having some strange behavior with this addon - see below:-

I get this repeatedly when editing especially the Expression field.

The screen goes to the "Wait for editing to finish" page but clicking on
Resume Now takes me back to the same page in a loop. If I sync I get
this message:-

Traceback (most recent call last):
File "aqt/progress.pyc", line 69, in handler
File "aqt/editor.pyc", line 466, in onUpdate
File "aqt/editor.pyc", line 538, in loadNote
AttributeError: 'NoneType' object has no attribute 'media'

If I then run Check Database I get:-

Traceback (most recent call last):
File "aqt/main.pyc", line 924, in onCheckDB
AttributeError: 'NoneType' object has no attribute 'fixIntegrity'

If I Check Database without prior sync I just stay in the loop.

If I Quit I get this message:-

Traceback (most recent call last):
File "aqt/progress.pyc", line 69, in handler
File "aqt/editor.pyc", line 466, in onUpdate
File "aqt/editor.pyc", line 538, in loadNote
AttributeError: 'NoneType' object has no attribute 'media'
on 1417564800
Works great for Chinese too!

I generated diagrams for my HSK Chinese deck with it, and out of 5001 cards, 4366 now have a diagram! Admittedly, I'm not sure what percentage of two character words have both diagrams, but still, this is awesome!

Thanks a lot!
on 1409097600
Quick user guide

Someone made a visual guide on how to use this here:
on 1406246400
This way is quicker to check the correct stroke order

I knew this addon for a long time but I didn't installed it becouse of KanjiStrokeOrder font.
Now that I have seen the new functionality to colorize by blocks and I gave it a try. It is awesome, specially if studing the kanji following the heisig's method. Thank you very much. This way is quicker to check the correct stroke order.

I thouht this addon only generates diagrams from the kanji jis x 208 character set. But funny stats are that it also generates 28 from jis x 212 and 8 more from jis x 213 only character set.
on 1404259200
Kanji Diagrams Not Showing Anymore

All of a sudden the diagrams are no longer regenerated.

I had a "Diagram" field with a value of "Japanese" (without) the quotes, in my model.
I also had a "Kanji" field with the Kanji characters.

After clicking the "Kanji Colorizer: re(generate) all" from the Tools menu,
the diagrams/Kanji stroke orders are not showing still.

It worked after adding some, but has stopped working since.

Any help?
on 1390694400

Wanted to complain about the program returning errors for unknown unicode characters but it was already fixed in the meantime... Works like a charm, thank you!
on 1387497600
It's pretty slow to download and install

But we are warned it's a big file. I tried to install it several times and I thought Anki crashed, but I gave it a little more time and it worked eventually.
on 1386460800
Super Add on, great developer

It works perfect and has been made chinese compatible (as much as possible) on request.
The colorized Kanjis are so good to remember. Thank you.
on 1351900800
A double saving time

This plugin obviously save time when entering a new kanji, but it also saves time during revisions: before that I used animations to learn the stroke order of a kanji, but I lost a lot of time to wait for the animation gets to the stroke that I wanted to check.

Attention, there is a small error in the manual: the field must be called diagram without the letter s.