Inkscape.org
Beginners' Questions Merge layers.
  1. #1
    Deleted User lachezar_lazarov 🚫

    Hello. How can I merge layers into one layer in Inkscape. 1.4 has a flatten function, but it does a different job. Krita has a function to merge layers, APS has flatten and locks them. This is a finished file that needs to be sent to print in tiff and all layers and paths merged and locked. Greetings.

  2. #2
    Polygon Polygon @Polygon🌶

    Probably: Select all elements on the canvas - right click->Move to Layer "x" - delete all empty layers in "Layers and Objects" panel.

  3. #3
    Deleted User lachezar_lazarov 🚫

    Thanks for the reply. Maybe so. But is it the same. I can't figure out what the purpose of this merging is before they go to press. Don't move layers and paths? Or is it more transparent for the printing house?

  4. #4
    Polygon Polygon @Polygon🌶

    Layers and Groups can have all kind of special properties including invisibility. Perhaps they need a simple file structure for trouble shooting if needed.

  5. #5
    Deleted User lachezar_lazarov 🚫

    It must be so, there is logic. Thanks for the answer.

  6. #6
    aperitero aperitero @aperitero

    You want to send a TIFF file to print, is that right? AFAIK you don't need to worry about Inkscape's layers, they will flattened anyway in the TIFF file.

  7. #7
    Deleted User lachezar_lazarov 🚫

    Hello. Thanks for the comment. My experience with Tiff is the same. But I see colleagues merge the layers and locking them before sending Tiff. Maybe this is some kind of insurance to keep the layers from moving around in the design? To be more secure if the automatic recording makes a mistake. That's how I do it, and I also started to practice it for all files before export. Merge into one layer for clarity and lock. Greetings.

  8. #8
    Paddy_CAD Paddy_CAD @Paddy_CAD

    You can lock Inkscape layers to avoid accidental edits, but here's no "layer merge" function. Polygon's answer in #2 is the simplest method. Perhaps your colleagues are using Gimp, which has this function.

  9. #9
    Deleted User lachezar_lazarov 🚫

    That's exactly what I was interested in, that the program does not have such a function to merge layers, but apparently I did not explain correctly. Of the programs I use, only GIMP, Krita and APS have such a function. For Scribus, Canva and AI, I'm not sure right now if there is or not, I'll have to check. Thanks for the reply.

  10. #10
    aperitero aperitero @aperitero

    Gimp, Krita and Photoshop being raster graphics editors, merge layer A with layer B = merge each pixel of layer A with each pixel of layer B.

    Inkscape, Illustrator… being vector graphics editors, there is no such thing as each pixel of layer X (because there are no pixels). That's why the concept of "merging" would not exist or would have a different meaning in this context.

  11. #11
    Deleted User lachezar_lazarov 🚫

    Hello. I don't agree with you. I wasn't sure about the AI ​​in the previous post I checked and it turns out it has a layer merge and it's a vector editor. The other thing I checked is why the layers are being merged. It turned out to merge layers only for printing, it doesn't matter if it's a bitmap or vector image for several reasons.1 They reduce the size of large files with many layers without affecting the image quality for easier saving and sharing. 2 As I guessed the files are merged because you get text errors when exporting files for printing most often with PDF when you don't use default font. After exporting it turns out that some fonts don't look the same. 3 When the layers are flattened, the design cannot be worked on and this guarantees the designer that his design will not be modified. I always design before flattening the files, I have to leave a copy that can be edited. If additional design work is required. I mean, I didn't use the word flatten in the post, I used merge because in 1.4 there is flattening in paths, but it performs a different function. I apologize if I mislead anyone with this. I hope the discussion was helpful. I learned a lot from her and it turns out that 1.4 has no flattening or we can't find it. Greetings.

  12. #12
    Tyler Durden Tyler Durden @TylerDurden

    Please note that layers in Inkscape are actually groups with special tags, because the SVG specification does not include layers.

    Inkscape adds special tags so users can enjoy the functionality of layer behavior, even though they are natively editing an SVG document.

    One should take care when moving objects between layers. When "merging" objects into a common/shared layer or group, it may be best to move from the higher layer into a lower layer to maintain Z-order (foreground/background relationships).

  13. #13
    Deleted User lachezar_lazarov 🚫

    Thanks for the reply. I didn't know that, but that's what forums and chats are for. Can you put an active link where I can find detailed information about tags and their behavior in Inkscape. Greetings.

  14. #14
    aperitero aperitero @aperitero

    I see how merging could exist in Inkscape, but it would be technically very different from what you get in a raster program:
      - in a raster program, if you have N layers with each one containing W*H pixels, you have a total of N*W*H pixels stored (of course in reality the layers rarely cover all the canvas). Merging means you end up with only one layer of W*H pixels - therefore considerably reducing the file size.
      - in a vector program, if you have N layers with each one containing let say M objects, you have a total of N*M objects stored. But merging would not change that, because all your N*M objects will still be defined in the merged layer. You will just save the data used for the definition of the layers. So you shouldn't notice a huge file decrease (unless you have a lot of hidden layers with a lot of stuff on them).

    About the fonts in exported PDF files: in the export options for PDFs, you can either embed the font or you can convert the text to path. So this should solve the problems with the fonts in PDFs? But I'm not a specialist of issues with PDFs.

    Layers are actually groups in Inkscape. If you open the XML editor with Edit > XML editor or open the SVG file with a text editor, you will see something like:
    <g id="layer1" inkscape:groupmode="layer"> The special tag that Inkscape create to know that this group is a layer is inkscape:groupmode="layer".

    As I said before, if you send TIFF or PDF files to the print, "merging" anything in the SVG file beforehand wouldn't change anything in the resulting TIFF/PDF.

  15. #15
    aperitero aperitero @aperitero

    By the way, all this made me realize that you could also ungroup all the layers thus ending with a flat file. You can do that with Extension > Arrange > Deep Ungroup. If you want to ungroup just the layers, use a "Stopping Depth (from top)" of 1.

    Notice also that all these operations (moving things between layers, ungrouping…) could change the appearance of your design: for example if you have a filter applied to a layer + a filter applied on an object in this layer, moving the object to another layer will makes it look different.

  16. #16
    Deleted User lachezar_lazarov 🚫

    Hello. Thanks for the comprehensive answer. With joint efforts, we will get to the solution of the problem. I'm also experimenting and looking for options, and for now I have a few options that I use for different types of files before exporting. Greetings.

  17. #17
    aperitero aperitero @aperitero

    Also, maybe your colleagues send their Illustrator or Photoshop's files directly to the printer (without exporting to PDF/TIFF…)? That's may be why they want them merged (to reduce file size among other things).

    I don't think your printer would accept SVGs directly, but it was the case, they would be similar operations (to the merge) that could be done in the SVG file.

    If you export SVGs for the web, there is actually a lot of optimisation that can be done (ungrouping, removing names…). There are even programs to do that, like SVGO. So, unlike what I implied before, there are ways to reduce SVG's file size, but they are mostly useful if you publish your SVG. As a source file (that you can edit), you most likely still need the layers, the object's labels, the groups…

  18. #18
    Deleted User lachezar_lazarov 🚫

    Hello. You might be right, the files can be flattened in AI. I don't believe they resort to the other options you described because it's too complicated for them, but I will experiment with them. When I work with a program I want to know what it is capable of 100 percent. I don't know if it's some kind of perfectionism, but it's easier for me in my work. Thanks for the reply.

  19. #19
    Tyler Durden Tyler Durden @TylerDurden
    👍*

    Saving a copy as... offers options on the SVG output formatting: Plain, compressed, optimized, etc. 

     

    • .svg, .svgz (SVGSVG compressed). Several options are available: Plain SVG and SVG with Inkscape extensions (for storage of Inkscape meta data). In theory, any program that reads SVG files should ignore the Inkscape extensions. One additional option is to save an “Optimized” SVG file. This file has been passed through the Scour script to make the file as small as possible.

  20. #20
    Deleted User lachezar_lazarov 🚫

    Hello and thank you for the answer and the illustration. This is good, but the most used files for printing that they want from me are - PDF, AI, EPS, CDR and TIFF. I don't know if I work like this with SVG compression, then when I convert to these files, what will happen. Greetings.