79 9
Contact Author Sign in to rate

Kanji Colorizer (stroke order diagrams)

51.06MB. Updated 2020-11-04.
The author has shared 3 other item(s).

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


The download will appear to freeze. Just wait, it will eventually 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" - or other model and fields of your choice; this is customizable the config found in "Tools > add-ons". 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 does not contain kanji it will generate diagrams for all characters "Tools > Kanji Colorizer > generate all new" will add diagrams to all such fields that don't already have diagrams. Or the "(re)generate all" option can be used to generate them all with new settings. 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 cayenne@hey.com. I do not get a notification when you post a comment on this page. UPDATES: 11/3/20: Option to not overwrite destination field if it already has something in it (thanks Andrew Reitz!). Helpful message instead of unhelpful error pane when you try to generate all new and there are no models matching your config. 8/2/20: Fixed a bug that broke generating cards with empty destination field on anki 2.1.28+ (thanks eternal-flame-AD!) 7/26/20: Fixed a bug on anki 2.1.28 and added setting to control whether to generate diagrams for non-kanji characters 7/20/20: Will now properly generate kana combination cards 5/31/20: Option to generate diagrams only for cards with an empty destination field (thanks ThundX!) 11/2/19: Hopefully fixed an error prevented it from loading it properly. 11/1/19: Configurable fields (thanks AyanamiSan!) 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.

Supported Anki versions:

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


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

All Anki 2.1.x Add-Ons Contact Author


on 1684949383
Fairly janky to set up, but I got it working. I always forget how to make it work when I need it again though, it feels like it sometimes doesn't work even when my Note Type has "Japanese" in it and I changed the settings in the kanji_colorizer.py file. The add-on settings from the menu don't seem to actually save or change anything, so you probably have to edit the python file directly.
on 1676762107
Doesn't work
on 1666939915
This is very helpful and is a lot easier to use than I thought (at least on ankiweb and anki desktop). But I have one issue and since I am new to anki I don't know how to resolve this. The Diagrams on ankidroid are displayed, but are really tiny, almost impossible to read.
on 1664448794
Never seen it work once, been trying to set source and destination for fields to see if it ever sets the diagram automatically, but nothing seems to work, and the add on config doesn't even display the code anymore, just the options, so I have no idea if it's the version that's messing it up or something else
on 1649775981
Works and is very helpful. Anki version 2.1.44
on 1642247203
Worked like a charm!
on 1639693753
Awesome. Just what I needed. Thank you very much for this.
on 1628489838
Great add-on!

Minor issue found: After changing "diagrammed-characters" to "kanji", after already having ran it, the kana is still visible. I was hoping (re)generate all would overwrite the diagram field back to empty.

edit: forgot I could just erase the field and re-add it :D
on 1625736338
Amazingly helpful, thank you for this!
on 1624818129
This is just what I needed for a stroke order deck I'm making for myself. Thanks!
on 1621906560
Thankyou this is perfect
on 1615952895
on 1615071427
Ferramenta muito útil
on 1612281508
thank you!! great add on
on 1604707583
I'm new to Anki and I had trouble to make this work for me but after watching a youtube video it worked!. THIS IS SO AWESOME!!!THANK YOU!
on 1603587424
this add-on is awesome. thanks so much!
on 1600077434
Fantastic, huge time saver
on 1599231988
on 1597756545
Awesome! Thank you so much.
Since phone manufactures won't even let you install new fonts nowadays, this add-on is probably the easiest way to get stroke order diagrams on all platforms.

Two hints for fellow users:
1. You don't only have to restart anki after installing the add-on but also after changing its settings before you can generate diagrams.
2. What the author is referring to as "model" is actually called "note type" in anki. Press ctrl+shift+n to manage them.
on 1597337737
It worked very well but I got something I don't like, those files with an added number at the end because it's duplicated and Anki adds that number. So I delete those and replace those references in the note field.
on 1595576400
Suddenly the add-on is generating strokes for kana as well as kanji. Is there a way to turn off the kana stroke generation, please? FYI when I click "Contact Author" I get diverted to the forum . . . which is fine . . . except I don't see how to start a new topic, which is not so fine. Help would be appreciated.
on 1595294751
When downloading, it froze and said "not responding." I just waited ten, fifteen minutes and it sorted itself out.
on 1592721060
Please help me ! The Stroke Diagram does not SHOW UP. Even though I did follow the instructions. How can I fix this?
on 1592324867
Good add-ons
on 1589130282
on 1588467174
Super and such a time-saver!
If you need to resize the images, just go to Add-ons > double-click on Kanji Colorizer > adjust "image-size" to your liking > Close this window > Tools > Kanji Colorizer: (re)generate all > then restart Anki :)
on 1588076715
I am not able to get the stroke order to show up. I have changed the destination and the source parts but the kanji diagram isnt showing up
on 1587265283
Immensely useful and skillfully developed tool that aides tremendously in the study of Kanji characters.
on 1584883128
very helpful!
on 1581866849
It worked
on 1578994685
download freezes at 51904KB and I can't download it
on 1578226000
i can't download it
on 1574179747
I love this. Thank's a lot.
Only drawback, it takes up a lot of space. I like having space to draw the kanjis myself.

So here's how I deal with that:
* create a scrollbox that only scrolls horizontally
* put the images in there
* resize it to fit the box
* hide them entirely and add a button with which we can display / hide the diagrams

<span style="font-size: 20px; "> {{Meaning}} </span>

<hr id=answer>
<tts style="display:none" service="android" voice="ja_JP">{{Expression}}</tts>
<span style="font-size: 40px; ">
<button onclick="showHideStrokeOrder()">Stroke Order</button>
<div id="scrollboxStrokeOrder" style="border:1px solid black;height:150px;width:100%;white-space: nowrap;overflow-y:hidden;overflow-x:auto;display:none">
<div id='strokeOrderPictures'>{{Stroke Order Diagram}}</div>

function showHideStrokeOrder() {
var scrollbox = document.getElementById("scrollboxStrokeOrder");
if (scrollbox.style.display === "none") {
scrollbox.style.display = "block";
} else {
scrollbox.style.display = "none";
function resizeStrokeOrderDiagrams(){
var scrollbox = document.getElementById("scrollboxStrokeOrder");
var imgs = document.getElementById('strokeOrderPictures');

var maxHeight= parseFloat(scrollbox.style.height)
var imgsHeight = imgs.firstChild.height

if(imgsHeight > maxHeight) {
var diagrams = imgs.getElementsByTagName("img");

for( i=0; i< diagrams.length; i++ ) {
var d = diagrams[i];
d.height= maxHeight -5;

on 1571493550
Great for learning kanji.

I see a lot of people strugling with the resizing of pictures even though it's simple.
Surprisingly you just have to go to : Plug-in > Kanji Colorizer > Config/Settings and change the "image-size" fields to what you want.
Don't forget to restart Anki for changes to take effect.
on 1569692121
For the ones that cannot resize stroke images, there is how I handled:

First, placed diagrams into a div.

<div class="diagram-div">

Then changed width of the images in this div.

.diagram-div > img {
width: 40%;
margin: auto;

I hope it helps.
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 1504137600
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 1496361600
on 1496275200
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 1493596800
on 1492560000
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 1485129600
on 1462147200
on 1459555200
on 1456185600
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 1423440000
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 1413763200
on 1412380800
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 1398729600
on 1394064000
on 1392508800
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 1381363200
on 1377820800
on 1355702400
on 1353369600
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.