You are here

Flatten all layer groups

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
flattenlayergroups.scm2.14 KB

Image > Flatten Layer Groups

Does exactly what you expect it to do. Every top-level layer group is merged (careful: only visible layers in each layer group are merged). The layer tree becomes completely flat. Why is this useful? Well, I made it because it is impossible to convert an image to Indexed mode or export it as animated GIF if it contains any layer groups. And layer groups are extremely useful for animated GIFs. It's a conundrum! And this script helps automate the process somewhat.

Code License: 
GIMP Version: 
Scripting Engine: 


Hi Grue, thank you for this awesome script. I try use him in windows command line, but he does not work.

My script:

@echo off
set gimp="c:\Program Files\GIMP 2\bin\gimp-console-2.8.exe"
%gimp% -i -b "(script-fu-flatten-layer-groups 1 \"test.psd\")" -b "(gimp-quit 0)"

Error Code:

(gimp-console-2.8.exe:4064): LibGimpBase-WARNING **: gimp-console-2.8.exe: gimp_
wire_read(): error
GIMP-╬°шсър: ╬°шсър т√чютр яЁюЎхфєЁ√ 'gimp-image-undo-group-start':
╧ЁюЎхфєЁр 'gimp-image-undo-group-start' т√чтрэр ё эхъюЁЁхъЄэ√ь шфхэЄшЇшърЄюЁюь р
ЁуєьхэЄр 'image'. ╤ъюЁхх тёхую, ьюфєы№ я√ЄрхЄё  ЁрсюЄрЄ№ ё шчюсЁрцхэшхь, ъюЄюЁюх
єцх эх ёє∙хёЄтєхЄ.

batch command experienced an execution error:
Error: ( : 4178310) Procedure execution of gimp-image-undo-group-start
failed on invalid input arguments: ╧ЁюЎхфєЁр 'gimp-image-undo-group-start' т√чтр
эр ё эхъюЁЁхъЄэ√ь шфхэЄшЇшърЄюЁюь рЁуєьхэЄр 'image'. ╤ъюЁхх тёхую, ьюфєы№ я√ЄрхЄ
ё  ЁрсюЄрЄ№ ё шчюсЁрцхэшхь, ъюЄюЁюх єцх эх ёє∙хёЄтєхЄ.

Can you help me please? Thank you!

Subscribe to Comments for "Flatten all layer groups"