KanjiVG based stroke diagrams on Jisho.org

77 views
Skip to first unread message

Kim Ahlström

unread,
Dec 2, 2010, 11:23:30 PM12/2/10
to KanjiVG
Hello,

This is Kim from Jisho.org. I've been a longtime fan and lurker of the
KanjiVG project. Really impressive work!

I just wanted to let you know that I've used the KanjiVG data to
generate stroke order diagrams for the site. Example:
http://jisho.org/kanji/details/%E7%BE%8E

I built a Ruby script to generate the SVG files with guidelines and
frames. I've released it under the same license as KanjiVG:
https://github.com/Kimtaro/kanjivg2svg

The repo also includes the generated SVG files that correspond to the
images on the site. To make the PNGs I used GraphicConverter (http://
www.lemkesoft.com/content/188/graphicconverter.html).

Huge thanks for making this data publicly available! Please let me
know if there's anything I can do to help the project.

Cheers,
Kim Ahlström

Alexandre Courbot

unread,
Dec 2, 2010, 11:34:03 PM12/2/10
to kan...@googlegroups.com
Hello Kim,

I just wanted to let you know that I've used the KanjiVG data to
generate stroke order diagrams for the site. Example:
http://jisho.org/kanji/details/%E7%BE%8E

Awesome work. Your site is AFAIK the most practical way to query Pr. Breen's data on the web. KanjiVG can only feel honored to have been included there.
 
I built a Ruby script to generate the SVG files with guidelines and
frames. I've released it under the same license as KanjiVG:
https://github.com/Kimtaro/ka

Thanks for sharing this. Actually I am currently working on a proper KanjiVG editor (it will be PyQt), and the data should become more easy to parse (one single SVG file with additional information embedded for every kanji) so you should expect a format change in the next couple of weeks. Fortunately it should not be too hard to adapt your parser (if needed at all) because you seem not to make use of the XML data.
 
Huge thanks for making this data publicly available! Please let me
know if there's anything I can do to help the project.
 
Contributors are always welcome, so if you or some of your acquaintances are interested in participating, checking existing kanji, adding new ones... The format may be difficult to understand because of the separate files and lack of documentation, but once I finish the edit tool and merge everything it should become much easier to jump in.

Also, if some of your users report you mistakes in the stroke order, we would be grateful if you could forward them to us or edit the corresponding page: http://kanjivg.tagaini.net/Main/IncorrectKanji

Thanks,
Alex.

Kim Ahlström

unread,
Dec 3, 2010, 12:05:36 AM12/3/10
to KanjiVG
On Dec 3, 1:34 pm, Alexandre Courbot <gnu...@gmail.com> wrote:

Hi

> Awesome work. Your site is AFAIK the most practical way to query Pr. Breen's
> data on the web. KanjiVG can only feel honored to have been included there.

Thanks! I'm very glad to hear that :)

> Thanks for sharing this. Actually I am currently working on a proper KanjiVG
> editor (it will be PyQt), and the data should become more easy to parse (one
> single SVG file with additional information embedded for every kanji) so you
> should expect a format change in the next couple of weeks. Fortunately it
> should not be too hard to adapt your parser (if needed at all) because you
> seem not to make use of the XML data.

Ooh, sounds interesting. I'll take a look at it when it's released.

> Contributors are always welcome, so if you or some of your acquaintances are
> interested in participating, checking existing kanji, adding new ones... The
> format may be difficult to understand because of the separate files and lack
> of documentation, but once I finish the edit tool and merge everything it
> should become much easier to jump in.
>
> Also, if some of your users report you mistakes in the stroke order, we
> would be grateful if you could forward them to us or edit the corresponding
> page:http://kanjivg.tagaini.net/Main/IncorrectKanji

Gotcha, I'll be sure to report any mistakes that comes my way.

Thanks!
Kim

Ben Bullock

unread,
Dec 3, 2010, 12:18:50 AM12/3/10
to kan...@googlegroups.com
On 3 December 2010 13:23, Kim Ahlström <kim.ah...@gmail.com> wrote:

> I built a Ruby script to generate the SVG files with guidelines and
> frames.

You've switched from Perl to Ruby now?

> I've released it under the same license as KanjiVG:
> https://github.com/Kimtaro/kanjivg2svg

Those look really smart, like a real kanji book. It's a big contrast
with my "random colours" method. Your squared line ends look better
than the rounded ones I used to me.

> The repo also includes the generated SVG files that correspond to the
> images on the site. To make the PNGs I used GraphicConverter (http://
> www.lemkesoft.com/content/188/graphicconverter.html).

People on the usenet group sci.lang.japan were telling me I should use
the SVG images in the browser, but it seemed to cause a lot of
problems even with the more modern browsers. Maybe you came to the
same conclusion?

The image server here:

http://kanji.sljfaq.org/kanjivg/

is just a C program which creates the PNG image in memory and sends it
to the user, without ever storing it as a file on the disk. I did it
that way so that it would be possible to offer any kind of size of
image or thickness of line, as the user required, without clogging up
the disc with millions of files. It also does something a bit similar
to Kim's:

http://kanji.sljfaq.org/kanjivg/memory.cgi?c=99AC&s=1&l=3&n=1&t=multi

which is used here:

http://www.sljfaq.org/afaq/stroke-order.html

By the way, I don't mind if people hotlink the images, like this:

http://budayangeblog.wordpress.com/2010/07/16/belajar-menulis-kanji-jepang/

and I can remove the watermark if any site wants to register with me
(also the copyright notice, as long as the site has a copyright notice
on its page).

Kim Ahlström

unread,
Dec 12, 2010, 4:48:39 AM12/12/10
to KanjiVG
On Dec 3, 2:18 pm, Ben Bullock <benkasminbull...@gmail.com> wrote:
> On 3 December 2010 13:23, Kim Ahlström <kim.ahlst...@gmail.com> wrote:
>
> > I built a Ruby script to generate the SVG files with guidelines and
> > frames.
>
> You've switched from Perl to Ruby now?

Yeah. I've used Ruby as my main language at work for three years now,
so have switched to it as my go-to language. Still do the occasional
thing in Perl though.

> > I've released it under the same license as KanjiVG:
> >https://github.com/Kimtaro/kanjivg2svg
>
> Those look really smart, like a real kanji book. It's a big contrast
> with my "random colours" method. Your squared line ends look better
> than the rounded ones I used to me.

Your rendition were my main inspiration. I first tried making numbered
lines like yours, but couldn't avoid the numbers overlapping. Then I
played around a bit to reach the implementation I went with.

> > The repo also includes the generated SVG files that correspond to the
> > images on the site. To make the PNGs I used GraphicConverter (http://
> >www.lemkesoft.com/content/188/graphicconverter.html).
>
> People on the usenet group sci.lang.japan were telling me I should use
> the SVG images in the browser, but it seemed to cause a lot of
> problems even with the more modern browsers. Maybe you came to the
> same conclusion?

Yes, SVG support doesn't seem to be good enough to use yet. I also
wanted to make sure I use Mac OS X's rendering engine, as I liked its
anti-aliasing better than for example Image Magick's.

> The image server here:
>
> http://kanji.sljfaq.org/kanjivg/
>
> is just a C program which creates the PNG image in memory and sends it
> to the user, without ever storing it as a file on the disk. I did it
> that way so that it would be possible to offer any kind of size of
> image or thickness of line, as the user required, without clogging up
> the disc with millions of files. It also does something a bit similar
> to Kim's:

Ah, that's an interesting way to do it. Does that allow for caching?

Cheers,
Kim

Ben Bullock

unread,
Dec 12, 2010, 7:09:21 AM12/12/10
to kan...@googlegroups.com
On 12 December 2010 18:48, Kim Ahlström <kim.ah...@gmail.com> wrote:


>> The image server here:
>>
>> http://kanji.sljfaq.org/kanjivg/
>>
>> is just a C program which creates the PNG image in memory and sends it
>> to the user, without ever storing it as a file on the disk. I did it
>> that way so that it would be possible to offer any kind of size of
>> image or thickness of line, as the user required, without clogging up
>> the disc with millions of files. It also does something a bit similar
>> to Kim's:
>
> Ah, that's an interesting way to do it. Does that allow for caching?

I wasn't able to make it work, perhaps because of the .cgi in the name
of the image server.

Julien Quint

unread,
Dec 12, 2010, 8:43:50 AM12/12/10
to kan...@googlegroups.com
On Dec 12, 2010, at 18:48, Kim Ahlström wrote:
> Yes, SVG support doesn't seem to be good enough to use yet. I also
> wanted to make sure I use Mac OS X's rendering engine, as I liked its
> anti-aliasing better than for example Image Magick's.

I'd be interested to know about specific issues you are encountering with SVG. I have unfortunately little time to spend on KanjiVG at the moment but I am working with SVG a lot right now and I may be able to help. After all that is the reason why I got involved in that project in the first place...

Julien

Kim Ahlström

unread,
Dec 14, 2010, 3:16:28 AM12/14/10
to KanjiVG
I didn't have any specific problems with SVG, and to be honest I
didn't test it all that thoroughly in different browsers and relied
more on a hunch that support wasn't good enough yet. I might go with
the native SVG route in the new version of the site that I'm building,
to allow for scaling for example.

But also partly the reason that I used GraphicConverter to make PNGs
was that I want a lot of control of the final look. Rendering the SVGs
in the browser would mean slightly different look on different
environments. And being a Rabid Mac Fan(tm) I want it to look like it
does on my machine :)

Cheers
Kim

Ben Bullock

unread,
Jan 7, 2011, 11:29:34 PM1/7/11
to KanjiVG
On Dec 3 2010, 2:18 pm, Ben Bullock <benkasminbull...@gmail.com>
wrote:

> By the way, I don't mind if people hotlink the images, like this:
>
> http://budayangeblog.wordpress.com/2010/07/16/belajar-menulis-kanji-j...
>
> and I can remove the watermark if any site wants to register with me
> (also the copyright notice, as long as the site has a copyright notice
> on its page).

Sorry but I just would like to publicly withdraw the statement above.
If anyone wants to use the image generator for hotlinking, please
contact me first. Apologies for any confusion this might have caused.
Of course the images themselves can be used under the terms of the
creative commons licence.

Reply all
Reply to author
Forward
0 new messages