Gimp-Forum.net

Full Version: How to delete several channels?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any way to delete all channels at once? Or to delete the selected channels all at once?

I recently installed a plug-in and as an indirect result of its main function (Create luminosity Masks) it creates several channels in this process.

A created mask ends up producing about 6 channels.
If I apply the plug-in again to get another mask, or others, new channels are created in addition to the ones that already existed.

With three masks created I had 24 channels.

There was a moment when I already had 71 channels created, none of them being necessary, since in the process the masks are created in the layers windows.

I could not delete the channels at once. I don't know how or if it's possible to do that.

Thx.
Can't find a script for that, not to say there is not one.

A work-around to lose all those selection channels

Saul Goodes script http://chiselapp.com/user/saulgoode/repo...ked-layers

Group all the layers
Drag the layer group into tools for a new image
Un-group the layer group

example: https://i.imgur.com/0BygKPr.mp4
There is no way to delete several channels in one action in 2.10.
You can do it only programmatically.
Open the python console menu Filters > Python-Fu > Console ; these 2 lines do the job (assuming you have only one image opened)
Code:
img = gimp.image_list()[0]
[img.remove_channel(c) for c in img.channels]
Rich2005, you are a genius!  Idea

I tried CTRL+D, but it doesn't work because the channels are also duplicated. You found a brilliant alternative!
Thanks a lot!

(01-08-2021, 07:30 PM)tmanni Wrote: [ -> ]There is no way to delete several channels in one action in 2.10.
You can do it only programmatically.
Open the python console menu Filters > Python-Fu > Console ; these 2 lines do the job (assuming you have only one image opened)
Code:
img = gimp.image_list()[0]
[img.remove_channel(c) for c in img.channels]

Initially I had 5 open images; nothing happened. I left only one open and voilà !
[attachment=5449]
This command is extremely useful, I think that the Gimp should have this feature in a basic way, already embedded as an option in the official version.

Thanks a lot!
(01-08-2021, 08:53 PM)Krikor Wrote: [ -> ]This command is extremely useful, I think that the Gimp should have this feature in a basic way, already embedded as an option in the official version.

Multi-selection of items (layers, channels, vectors...) is a incoming feature in gimp 3.0
https://www.gimp.org/news/2020/12/25/gim...-selection
(01-08-2021, 07:30 PM)tmanni Wrote: [ -> ]There is no way to delete several channels in one action in 2.10.
You can do it only programmatically.
Open the python console menu Filters > Python-Fu > Console ; these 2 lines do the job (assuming you have only one image opened)
Code:
img = gimp.image_list()[0]
[img.remove_channel(c) for c in img.channels]

Code golfing:

Code:
map(image.remove_channel,image.channels)

Smile
(01-08-2021, 05:45 PM)Krikor Wrote: [ -> ]I recently installed a plug-in and as an indirect result of its main function (Create luminosity Masks) it creates several channels in this process.

A created mask ends up producing about 6 channels.
If I apply the plug-in again to get another mask, or others, new channels are created in addition to the ones that already existed.

Can I point out that there is no such problem with ofn-luminosity masks Smile