I want to reduce the file size of a SVG image by making a copy of my Illustrator document and merging all the layers. But how do I do it?
I've checked out several references, but none of them work for me. I can't find a "Flatten Artwork" or "Merge Layers" option. Clicking on layers while holding down the Command or Shift key doesn't work, either. On top of that, I have a lot of layers that I can't click to begin with. There's no way to select them.
Has the process changed in Illustrator 2021?
Have you tried "Flatten Artwork" from the Layer panel flyout (upper right)?
Ah, that's where it was hiding. 😉
I applied it, and it did reduce the file size. I noticed that I still have lots of layers, though. More precisely, I have lots of sublayers that have been consolidated into one layer. Is that the way it's supposed to work? I thought I would wind up with just one layer.
You could also Select all the remaining Layers and use Merge Selected from that same menu or use Collect in New Layer from that same menu.
Sub-layers? You are not referring to paths, are you?
If those are paths, you would need to use pathfinder functions to combine them (from the pathfinder panel). Will only have the desired outcome when they also all have the same color. Do they?
No, they have various colors.
It's an image of the globe, with many different layers for the sea, many more layers for the continents, etc. I just thought it ought to reduce the final file size if I could somehow compress all of those layer into one bigger layer.
Layers don't produce filesize, paths and anchor points do. You have a lot of objects and a lot of colors: your file will be huge.