Arrange/align tool development - Add align and distribute to canvas / first or second object selected

Hi,
I’m trying Krita and I’m fashinated by the idea of mixing rasters and vectors together.
I’ve been a logo designer for a long time. For me vectors mean “elements alignment”, align elements to each other, to the canvas, to a certain object.
I’m looking for these features in Krita, but I can’t find them, I can only aling two or more elements by average. This makes the aligning tool just a “move every element randomly on the canvas”. It is just a waste of potentiality.
Is it possible to implement the arrange tool in such a way?
Illustrator gives users the option to select the object you want the other objects to be aligned too by simply clicking it again after the initial selection. Easy, fast, functional.
If I’m missing it and these features are present and I could not find them sorry in advance for the post.

Best.
F.

Hi @Centunesima - Welcome to the community. Are you using the arrange docker? I don’t use vector tools often in Krita but I find it quite similar to the alignment tools in Inkscape.

Playing with it tonight, I just made a series of ellipses and was able to stack them, centre them on each other and also redistribute them equidistantly.

Maybe you can describe a little more what you’re trying to do. It’s possible that Krita already has what you’re looking for but you’d need to adjust your process. There are lots of people here willing to help.

2 Likes

Hello and welcome to the forum,

To complement @sooz answer: Go to SettingsDockersArrange
A new docker will appear where you can arrange and align vector shapes.
Captura de tela de 2021-12-24 00-14-08

These doesn’t do everything you want? If not, what are they lacking? It would be really good to improve Krita’s vector capabilities in this case.

Cheers.

2 Likes

Thanks for the answer.
The align tool (center, side , etc.) seems to work by average distance only. One object on the left, one on the right, then they align in the middle. While you should be able to decide if you want the right element to be centered relatively to the left one, left one that will stay still. Or you should be also able to align both to the artboard.
These options seem missing to me.
It is a minor fix. But without them you can’t properly design with vectors.

Thanks for the answer.
I managed in finding the dock.
The align tool (center, side , etc.) seems to work by average distance only. One object on the left, one on the right, then they align in the middle (both move). While you should be able to decide if you want the right element to be centered relatively to the left one, left one that will stay still. Or you should be also able to align both to the artboard.
These options seem missing to me.
It is a minor fix. But without them you can’t properly design with vectors.
(Same for the distribute. Ditribute among selected objects, relatively to canvas’ width/height, relatively to a third object)

While things improve in Krita, as a temporary solution you can design things with vector very efficiently in Inkscape. Once you design things in it you can bring those designs as vectors in Krita by mere copy pasting across application.

Inkscape has a robust align, distribute, and even swap features

2 Likes

@raghukamath I was wondering, to what extent is it possible to adopt Inkscape code for new vector functionality? Apart from the UI, how much of this is manual labour?

1 Like

Just understand that in Krita, your vectors are still displaying as raster and will not maintain clean edges as you zoom in, so for final logo output you’d want to finish in something like Inkscape or Illustrator.

1 Like

I’m fashinated by Krita because of its being 2 in one.
Already have both Inkscape and Illustrator.

Did not know that. :+1:
Got it. So the final output is forced to the native resolution of the document only?

Can’t you export pure Svgs of your composition?

I didn’t test it (or know enough about vector drawing), but I’m certain if you only have vector layers exporting as .svg preserve the vectors to be used on others programs.

Although I’m now curious on what happen when exporting a .svg with a mix of Pixel Layer and Vector Layer. Does .svg support multiple layers?

1 Like

In krita, you can export a vector layer as .svg by using:
Layer → Import/Export → Save Vector Layer as SVG
This gives an .svg file as output and that can be opened in Inkscape or GIMP (paths only) and other vector applications.

If you have an .svg file, you bring it into krita with:
Layer → Import/Export → Import Layer then a vector layer will be created for the content. There is an option to specify the ppi when you import it.

Krita does not support images in vector layers.
Inkscape does support embeded images and these are encoded as data blocks of the image file data. (It also supports links to image files.)
If you try to Import this into krita, the file preview will show the embeded image but it will not be imported, except as an empty ‘image box’.
I don’t know if this is a bug or it was deliberately left out.
I suspect it was left out to simplify things. After all, if you want images in krita there are paint layers.

Inkscape does have what it calls ‘Layers’. These are higher level group structures with the special Inkscape identifier:


 <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
     etc

These are only output if you specify ‘Inkscape.svg’ in the Save options.
For ‘Plain.svg’, you get:


 <g
     id="layer1">
     etc

This ‘support’ for multiple layers is a trick that involves reparsing the .svg file and ignoring the block which contains the label of any layer that is set to be invisible.
As such, you can have a ‘multi-layer’ Inkscape file and isolate a ‘layer’ by turning off the visibility of other layers and then Export as .png.

If you Save as .svg, the group is marked with a display mode of None.

2 Likes

Actually, it does? That’s how reference images are stored. And double checking, yeah I can open SVGs with embedded images (though, linked images may not be possible, no). There’s no way to embed an image in a vector layer, though, and our idea for exporting SVG was focused around the idea of storing raster images as embeded rasters, but we never got around to actually implementing that. Which is why saving out SVGs goes via the layer menu, and not via file->save as.

Anyway, if we implement that, we’ll try to have compatibility with inkscape, or offer the option for that at the least.

As for the rest of the topic, I now remember I used to have a patch that put all the arrange features into the context menu for shape selection and editing, because y’know, it only applies to nodes and shapes you’ve selected, but when I suggested we didn’t need the arrange docker anymore, I got feedback from several people that we must absolutely keep it, and then the patch got lost in the phab->gitlab move…

1 Like

The reason I asked about inkscaoe implementation is that I find Krita’s interface a lot more suitable than Inkscape. The same point can be made about Gimp vs Krita. So if Krita could improve upon what’s in inkscape by making it more procedural, then you’d have a really complete software package all across the board.

Illustrator has become increasingly bloated and buggy imo, while Affinity Designer is still unable to compete in terms of sheer numbers of features (meaning some things aren’t possible or require tedious workaround). The same goes for Inkscape, which, from what I have seen is all about creating and deleting, you can barely reuse things by changing some parameters. Krita has this procedural approach and is very user friendly, so while it may not be performant enough for extremely large file sizes, Krita has the same potential as Affinity Designer, if not more.

By bringing things from Inkscape over, Krita would be able to become the king of 2d, just like Blender has overshadowed the likes of Wings3d. Wouldn’t that be awesome? More potential for funding and a more versatile software. Anyways, interesting discussion about SVGs.

1 Like

With the 5.0.0 appimage on Debian 10, if I ask to Open an .svg file with an embedded image made in Inkscape, Saved as either Inkscape.svg or Plain.svg formats, I see this (the rose is the embedded image, of course):

Then a vector layer is made and it has this showing:

Notice the empty space where the image is supposed to be but there is ‘something’ there.

If I ungroup and delete the visible objects, I get a ‘blank’ object that svg Exports as:

<defs/>
<image id="image0" transform="matrix(2.83465058 0 0 2.83465058 39.5870660603895 410.38829520286)" width="173.39732px" height="130.048px" preserveAspectRatio="none"/>
</svg>

What am I doing wrong, or what are you doing right?

:confused: no clue.

Guess I’ll be doing a deep dive in the svg parser after the holidays :slight_smile: (also found a gradient bug a while ago I want to look at).

2 Likes

This Arrange toolbar should be usefull for all kind of layers!

1 Like

Agree, based on bounds of layer for raster layers :).

I think request is the same as https://krita-artists.org/t/adding-the-possibility-to-use-the-arrange-docker-with-any-kind-of-layers so we should probably merge these two.

1 Like