Export layer to png file in gimp

14

Is there a simple way to export the current selected layer as a png/jpg file in Gimp 2.8.4 ?

I did some searching in google, and the export should do it in gimp 2.6 if the layer is the only visible layer, but I can't get that to work for gimp 2.8

The way I currently do it now is that I select the content, and cut/paste it to a new image, then export the image and close it, but a simple export selected layer would be much more easy to use.

MTilsted

Posted 2013-03-27T19:10:32.730

Reputation: 982

What OS are you using? – terdon – 2013-03-27T19:39:22.613

2Linux. (Fedora but how does that matter?) – MTilsted – 2013-03-28T04:17:24.843

You never know, there are often differences in the same software between OSs. – terdon – 2013-03-28T12:24:46.603

Answers

10

  1. select layer
  2. press ctrl+c
  3. press ctrl+shift+v (=paste as new image)
  4. export as whatever you like

movAX13h

Posted 2013-03-27T19:10:32.730

Reputation: 201

2Why was this downvoted? Easy, simple, without downsides. Okay, this should be possible with GIMP, it's such a basic functionality. – itmuckel – 2019-03-23T13:15:50.323

This is the best answer way simpler and faster than any here. No plugins, no downloads, no lies about making a layer invisible and exporting the image as if it was a layer. This is the way we can export just the layer. Thanks. – Machado – 2019-05-30T14:21:40.847

7

I can do this on GIMP 2.8.2 running on Linux. The image below has two layers, one blue and one black.

enter image description here

If I export the image as is, I get a blue png. Now, set the blue layer to invisible:

enter image description here

If I now export this image (CtrlE) I get a nice black .png:

enter image description here

terdon

Posted 2013-03-27T19:10:32.730

Reputation: 45 216

@MTilsted If I understand your issue correctly you can go to Image > fit canvas to layer to have the image without the transparent area around it. – wranvaud – 2019-02-27T13:26:29.107

Your images are missing – mrbengi – 2019-03-02T14:45:17.700

1

@HQtunes.com no they aren't, not for me anyway. Perhaps you are blocking https://i.stack.imgur.com?

– terdon – 2019-03-02T14:46:16.867

@terdon, no I have not blocked. But the link also broken in my pc.. – mrbengi – 2019-03-02T14:56:46.420

1@HQtunes.com well something must be blocking it. Maybe it's blocked in your country? There's nothing special about the images here, they're hosted on imgur like any other image uploaded to Stack Exchange. I can see them from both computer and phone and so can other users I asked in chat. I am afraid this isn't something I can fix. – terdon – 2019-03-02T15:06:21.553

@terdon okey I have learned that it is blocked in our country – mrbengi – 2019-03-03T08:32:17.537

2That works except for 2 things. The result image when exported as png still has the same size as the original image. So try to make your black box smaller and then export it. You will end up with a small black box, with a large transparent area around it. – MTilsted – 2013-03-28T04:17:06.720

2

There is a GIMP plugin to export as layers: Export layers plugin

This plugin does not have the option of exporting only the current active layer - however it uses square brackets in the layer names to determine how it treats the layers.

Thus to export your current layer you could:

  1. Install this plugin (you will have to restart GIMP)
  2. Rename the layer or layers you wish to export, surrounding their names with square brackets e.g. [my image]
  3. Select "Export layers" from the file menu
  4. Enter the extension for the format you want to use in the extension field
  5. Under advanced settings change the "layer names in [square brackets]:" option to "Ignore other layers"
  6. Click export layers

Ben

Posted 2013-03-27T19:10:32.730

Reputation: 121

2

I hit upon a simple workaround under windows: I select the layer that I want to copy in the GIMP, press control+C to have it in the Windows clipboard. Then I open Irfan View as a separate application and I paste in the contents of the Windows clipboard with control+V. Then the pasted image can be saved to disk in whatever format I like.

user3149374

Posted 2013-03-27T19:10:32.730

Reputation: 21

That works as easily by pasting into a GIMP window with a new image – jpaugh – 2018-12-08T03:42:34.500

0

Note that the "Save As" operation ignores layers and visibility in formats where layers are not supported. Merging or flattening the image for export is a separate operation available before Gimp converts the format, and it is not mandatory. You can skip the flattening and merging operation by clicking "Ignore."

When you chose to "Save As" from the file menu, by default only the active layer is exported unless the target format supports layers. For example, if your image has three layers and you want a PNG image, the PNG will only have graphic information for one layer: the active layer, UNLESS you flatten the image or merge layers.

Now to save three layers as three images, you need to make three "save as" operations. The steps below outline the sequence for creating separate images from layers.

  1. Ensure the editor window is active with the top layer selected.
  2. Press "CTRL-SHIFT-S" for the Save As dialogue.
  3. Choose your output format, and file name for the FIRST page. Press "Enter"
  4. On the Export dialogue, choose "Ignore"
  5. Set the options for your destination format and press "Enter" or click "Save."

    You are now returned to the image editor window. Repeat the below steps for each layer.

  6. Press "Page Down" to activate the next layer.
  7. Press "CTRL-SHIFT-S" for the Save As dialogue.
  8. Choose your output format, and file name for the NEXT page. Press "Enter"
  9. On the Export dialogue, choose "Ignore"
  10. The options for your destination format are remembered. Press "Enter" or click "Save."

A Script-fu could easily handle this.
Using layer keyboard shortcuts you can export each layer in very few steps.

Cerberus

Posted 2013-03-27T19:10:32.730

Reputation: 1