How to convert text to image with Images.jl?

How to convert text stored in a Julia string to an image of given size? For example, let’s say we are given the word “Julia”, how can we generate the logo with WIDTHxHEIGHT pixels?

1 Like

Use a plotting package or Luxor.jl?


If you just want text over an image, ImageView.jl has an annotation API.


@mkborregaard, thanks for sharing Luxor.jl, it looks awesome.

@dfdx, the annotation API is very helpful, will play with it, thanks.

Yes, it’s great - and it has a julialogo function to draw the julia logo (which I know isn’t what you were after but still cool :slight_smile: )


Wow Luxor.jl is so stupid amazing! But boy dojulianshateunderscores…



I had to stop using underscores when I used Mathematica (they’re not allowed in variable names). I had to stop using hyphens when I stopped using Lisp. I’m getting used to the “join words when readable” style.

I missed these ones, though:




lol … oh man it will hurt when we have to do intersectionlinecircle() :slight_smile: Thanks so much for Luxor.jl. Been losing my mind using it lately. Love it so much. I have been thinking about trying to have it write to a Gtk.jl canvas, I haven’t looked at the code, but being based on Cairo do you think this would be feasible for a mortal to implement?

1 Like

It might be possible. It is very un-interactive, I agree. I tread very warily in Cairo waters, and avoid them whenever possible…

Personally I tend to focus on a simpler UI and larger and more static graphics. I think Julia should definitely offer interactive graphics, and projects such as gtkreactive and glvisualize are probably where the future is.

It’s possible, i have done this locally. I added functions to access the surface in the Luxor currentdrawing and attaching to the surface from the context in a Gtk canvas shouldn’t be problem (read as: i had a plan to do it, but got distracted by other problems, mainly v0.6 in Cairo).

sweetness! That is what I figured, from a memory long ago of working with Cairo. I will see if I can put something together!

the unregistered can draw text into a matrix.

1 Like

Thank you @bjarthur, one more package to add to the collection.