"Export for Web" choosing its own canvas size

Talk about Pixelmator Pro, share tips & tricks, tutorials, and other resources.
User avatar

2021-03-04 14:05:22

Hello, currently using Pixelmator Pro Version 2.0.3 Junipero.


I recently learned of the trick where dragging layers from Pixelmator into a Finder window will export each layer as an individual file. However, if I do this with PNG images that have transparent borders between the edge of the canvas and the visible portion of the image, the image is reduced in size until there is no transparent border.

I'm not really intending to "Export for Web"; I'm simply trying to save the entirety of each layer. Is there an Export option that doesn't attempt this optimization?

Thanks!
User avatar

2021-03-05 11:46:03

Hey there! That definitely isn't expected behavior and to be fair, I've been unable to reproduce it myself. I can see that you're running Pixelmator Pro 2.0.3, though. Perhaps updating to the latest available version (Pixelmator Pro 2.0.5) would help here?
User avatar

2021-03-11 05:48:51

Hi Aurelija, thanks for responding. I've upgraded to 2.0.6. I actually think the behavior is intentional, because if you select layers and choose 'Add for Export' from the context menu, web-based 'slicing' tool guides appear:

Image

As you can see, the exports for the layers 'green' and 'red' have sizes related to their content (103x106, 207x198), unrelated to the exposed canvas size (256x256). The "presets" menu for PNGs has a "keep transparency" option but that's only for the actual alpha channel of the resultant PNG, not anything related to the dimensions of the canvas.

Thanks!
User avatar

2021-03-15 15:08:53

Oh, that explains it! Thanks for clarifying. That is, indeed, expected behavior if we're talking Add for Export. It's really meant to isolate and export just the contents of the layer, regardless of the rest of the design. Since the transparent background is its own separate layer, it's not taken into account. So, you have two options here:

a) Manually expand the bounds of a slice to also include the background layer.
b) Don't add individual layers for export but Export for Web the entire image. Before dragging and dropping the images to Finder, simply hide the unnecessary layers.
User avatar

2021-03-15 15:32:40

Neither of those are really workable with hundreds of layers. Is there no other way of mass-exporting layers in this manner?

Thanks again, I appreciate your looking into this :-)
User avatar

2021-03-18 15:59:39

Since these are quite specific export conditions, only one option comes to mind — scripting. If you have experience with AppleScript, you should be able to set up a workflow that automates this whole process. Let's say, you can tell Pixelmator Pro to hide all layers except the background one, then go through every other layer by revealing, exporting, and hiding it again.
User avatar

2021-03-19 10:48:42

I'm also looking forward this feature, It's sad not to have an option to use full width image slices while exporting multiple layers for the web :disappointed: