LibreOffice Conference 2026: AI extension for LibreOffice Draw
Watch on YouTubeVideo summary
Shatami introduces his new LibreOffice Draw AI extension, a Python-based tool designed to streamline vector graphics creation and editing through natural language instructions. As a software engineer who previously developed an AI module for Writer in 2023, Shatami aims to solve the tedious process of manually clicking through menus to change colors, sizes, or positions of shapes. By allowing users to simply type commands like "create a pelican riding a bicycle" or "change the bear's ears from circles to triangles," the extension translates these requests into precise operations within LibreOffice Draw, significantly reducing the potential for human error and saving time on repetitive tasks.
The technical foundation of this tool relies heavily on SVG (Scalable Vector Graphics), an XML-based format that serves as a common language between LibreOffice and AI models. Unlike raster graphics editors such as Photoshop, vector applications deal with mathematical shapes that can be scaled arbitrarily, making SVG ideal for technical charts and scalable designs. The extension communicates with Large Language Models (LLMs) to generate or modify these SVG files, which are then inserted directly into the document. Shatami highlights that while proprietary tools often require expensive subscriptions, this open-source approach allows users to leverage powerful AI capabilities without paying per token, provided they have the necessary hardware or access to local models.
A critical design priority for this project is user privacy, which is addressed by supporting both local and cloud-based AI configurations. When running locally using tools like Ollama with models such as GLM-5.3 or Qwen, the extension processes data on the user's machine, eliminating the need to send sensitive information to external servers. For users without high-end hardware, a manual mode is available where requests are copied to the clipboard and pasted into a preferred AI interface, offering flexibility while maintaining control over data handling. Although current performance can be slow with limited GPU memory, Shatami notes that future updates will focus on improving undo/redo functionality, adding sidebars, integrating with his previous Writer extension, and enhancing support for complex 3D shapes.
Read the full video transcript
In the name of God. Hello, I'm Shatami
and today I will present my new
extension that makes it possible to use
AI tools in Libra Office. This is the
list of contents that I will discuss in
this presentation.
I'm a software engineer and I'm using
Libra Office for a few years now. I
developed the first AI extension for
Libra office in 2023 which was devoted
to Libra office writer. That extension
can create text and image with the
instructions from the user. It can also
do some editing and translation tasks
based on the input from the selected
contents in writer. that extension
connected to chat GP and after that
other extensions have been developed
extensions used AI in Cal writer impress
and draw
then let's see the new extension it's
called draw AI it is a lira extension
written in Python that lets people to
create and edit shapes in Libra office
draw but with natural language. Users
type their in their instructions
and will see the resulting draw. This
means instead of many clicks, we can
type a sentence and AI send operations.
A famous example to examine the SVG
generation functionality
of the AI tools is to ask generating
some cartoons. The one that you see here
is generated by asking to create a
pelican that rides a bicycle. This is
the output of GLM5.3
from Z AI running locally with Olama.
You may see better or worse outputs
depending on the AI tool and model that
you use. Imagine we want to change color
or size of pieces of this shape. If we
want to do this operation without AI, we
should select shape, open color panel,
select color, we should do these steps
for all pieces.
And for changing size or moving shapes
also we should clicks and calculation a
lot. It's boring. This process has a
high probability of error.
Draw AI extension is my solution for
creating and editing shapes. It connects
Libra stro with AI.
Libra fistro that many of you actually
use is a vector graphics editing
application.
It used for many operations from quick
design to technical charts and
three-dimensional shapes. There are
similar proprietary
applications like coral drawer, vio and
etc. which do vector editing and this is
different from Photoshop and
applications like that which are photo
and raster graphics editors.
Also, Libra can import and export of
various different
vector formats including OG.
It's native format, PDF and SVG. I use
SVG format extensively in my extension
and also Libra store has different
readymade shapes.
AI is integrated into proprietary
vector editing applications in various
levels. Use of AI in different levels
from the original idea to design and
shape management is something that's
doable with AI. Also, AI helps do
repetitive tasks which is otherwise
tedious. These tools require
subscription and can be costly for the
user.
When you are creating or editing vector
graphics, you are dealing with shapes
that can be modified and displayed in
arbitrary sizes. On the other hand,
raster graphics are suitable for
different purposes like picture and
things like that. Here we focus on
vector editing and specifically SVG
files.
SVG is an XML
based format that can be a common
language between Libra office and AI
tools. Both Libra Office and AI tools
understand it well. Libra Office can
open SVG files, export files to SVG and
insert SVG files as drawings.
This helps the extension development a
lot.
Here you can see a simple SVG file
displayed as text. The result is the red
square that you can see on the right.
You also see the nice looking B near
that which is also created using AI as
SVG. This is a more complex example of
vector graphics that's stored as
SVG.
Drawi functionalities are shape creation
and shape editing. With user
description, Draw AI can create simple
or complex shapes. And also with user
request, it can change shapes, color,
move or delete shapes, add new shapes,
and add or modify text. As you see, I
asked it create a nice threedimensional
bear with pink color. And after that
I asked it to change eyes color from
black to green, bear's color from pink
to blue, create a in the hand of the
bear with red color and hello text. And
also I asked to change bear's ears from
circle shape to triangle.
In our previous extension that was
working in writer, we simply sent our
message which could also invite the
selected text alongside the user request
in return AI tool send the result in
text format and we could insert that in
writer in a proper format. Even color
and formatting was something that was
done by the extension and not AI itself.
But to edit the shapes, we need a new
form of communication between our
software and LLM.
This diagram shows different scenarios
for using
draw AI extension. At first user
requests through user interface of the
extension in libra.
It's important that the AI tool is local
or not. If it's local then local process
answers the query and you may see
instant increase in GPU usage. If it's
not local then you may use other cloud
models that are available in ola.com.
You have to pay for them.
An alternative is to use manual model.
In this way request to AI is copied to
clipboard. user paste it into the AI
tool user interface and copies back the
result into the draw AI extension.
In any of these three ways, the received
operations are executed and possible
received SVG files are added to Drew. In
that way
you will edit the the document with your
request in a natural human language.
User request to AI includes user
instruction selected shapes and their
size and positions
and all data is serialized as SVG and
JSON format.
and response should be in JSON objects
format. Some of the rules are don't send
explanations, codes and markdown, answer
only in JSON format.
Supported operations
are shape addition, shape creation, SVG
operations and deletion.
Shape addition includes move, set size,
set text, add text, and some shapes like
rectangle, ellipse, and line. Shape
creation includes set fill color, set
line color, set position, and set size.
SVG operations are insert SVG, replace
with SVG, and replace selection with
SVG.
Deletion includes delete shape.
There is another extension write agent
which can be used in different libra
office applications including Libra
office but it is not specific to Libra
office. It uses delegation mechanism to
do editing
which means it asks AI to use the libra
stro primitives to edit shapes. This can
be good for simple shapes but when it
comes to more complex shapes it doesn't
necessarily work well and fast. We use
SVG and higher level operations which is
better in two aspects. AI tools are
trained extensively for generating SVG
shapes and that improves the result.
We use higher level commands that works
better on more complex shapes. Our test
were done using a local instance which
is not that fast. Therefore, the
difference in performance was quite
visible.
Implementation and execution.
The extension code is implemented in
Python. The Python code has different
modules. ing them. I can mention draw
edit which is the main class of the
code. It creates with request to LLM
send the request and receive the answer
from LLM. Then it validates the answer
and applies the instructions to the
shapes.
Clipboard
is implemented using extra extraable
service from libra to copy the request
to the clipboard in manual mode.
Settings are stored as config files but
we may change this in the future and use
libra configuration for that. We created
GUI using libra API called comson.star.
AWT.
We have used LLM in some areas that I
will describe.
I have used GLM 5.3 model from Z AI for
code assistance.
to run the extension. I have used quen
3.88
for shape generation and it was good.
And this laptop I only have 4 GB of GPU
memory so I use quantry which is not
that strong.
Generating complex shapes takes a lot of
time and [clears throat] it requires a
few minutes to generate output.
Here manual mode helps.
Extension copies the request to the
clipboard. Then you may use a web based
free service get the output and paste
the response. Otherwise, you need to buy
LLM API subscription and pay per tokens
that you use.
These are some of the challenges.
If you want to get good results, you
should either wait for a long time, even
5 to 10 minutes, or pay for expensive
API price or buy expensive AI hardware
with a lot of RAM.
That is a problem with the LLM itself,
and I hope the situation improves in the
future.
Handling more complex shapes is also
challenging and I think this can also
improve with AI improvements.
And the last challenge is privacy. I
will talk about this with more details.
When using cloud-based services, privacy
is an important issue. Our extension is
connected while caring about privacy
without privacy when creating the
extension and it was one of the
important consideration
in the design. The use of local amma is
a key here as it solves most of the
privacy issues. Also, it's possible to
check the input to AI and output from it
both in terminal and also more carefully
in manual mode.
One drawback is that as said one will
require a good AI hardware
with a lot of RAM for AI to give good
and fast results.
Future plans are integrating with my
previous writer extension, improving
undo and redo, using sidebars,
supporting more internal commands, and
improving 3D support.
Thank you very much.
I want to show you demo of this
extension. This is the menu of drawer
extension. Now I want
to click edit with AI and
I want to ask this operation create a
chicken
that is in the tree
color
in the center of the
page
and okay I use manual mode
Then this request copy to clipboard
I paste it here in AI tool
and that's Z AI and I'm waiting for
response.
This is the response of Z AI.
I copy it
and paste here.
Okay,
this is the
result.
And now
I want to change the color or some of
pieces
of this shape. I select it
and
once again
edit the oil
All right.
Okay,
this is the response.
And
as you see
the
color of the eyes change to green.
Okay. Now I want to change the color of
the chicken.
I select this shape.
Draw my eye.
Okay.
The color of the chicken change to pink.
Now I want to add some shapes.
Then I select this shape
AI edit with AI and create a table
near the tree
and put a
and the table.
Okay, this is the result.
Thank you very much.