Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing Alpha Channel?
#1
I have been trying to write a script to automate colour cast removal.
If an image has transparency it "dilutes" the colour cast I am trying to remove.
When I run the following code

Code:
layerClean = pdb.gimp_layer_new_from_drawable(layer, image)                                                    # layer to be cleaned of alpha channel
pdb.gimp_image_insert_layer(image, layerClean, None, 0)                                                        # insert layer
pdb.gimp_image_set_component_visible(image, CHANNEL_ALPHA, FALSE)                                            # make alpha channel non-visible
pdb.gimp_layer_flatten(layer)                                                                                # remove alpha channel
pdb.gimp_image_remove_layer(image, layerClean)


I can look in the channels palette and the alpha channel has gone. In the layers palette I can right-click on the layer and it gives me the option to add an alpha channel. However, if I carry out any action, such as adding a layer, the alpha channel re-appears in the channel palette.
I have tried running the code and then doing a "Save as". On loading the saved file, the alpha channel is again in the layers palette.
I created an xcf file where the alpha channel was filled with 50% grey (7f7f7f Hex) in order to test.

   

I put this into general queries as the same occurs when the actions are carried out manually.

Operating system: Ubuntu 20.04
GIMP: 2.10.32
Reply


Messages In This Thread
Removing Alpha Channel? - by david - 07-26-2022, 02:27 PM
RE: Removing Alpha Channel? - by Ofnuts - 07-26-2022, 04:11 PM
RE: Removing Alpha Channel? - by david - 07-26-2022, 06:05 PM
RE: Removing Alpha Channel? - by Ofnuts - 07-26-2022, 07:34 PM
RE: Removing Alpha Channel? - by david - 07-26-2022, 08:14 PM
RE: Removing Alpha Channel? - by PixLab - 07-27-2022, 01:58 AM
RE: Removing Alpha Channel? - by david - 07-27-2022, 07:38 AM
RE: Removing Alpha Channel? - by rich2005 - 07-27-2022, 07:51 AM
RE: Removing Alpha Channel? - by david - 07-27-2022, 11:54 AM
RE: Removing Alpha Channel? - by Ofnuts - 07-27-2022, 05:33 PM
RE: Removing Alpha Channel? - by david - 07-28-2022, 09:34 AM
RE: Removing Alpha Channel? - by Ofnuts - 07-28-2022, 12:08 PM
RE: Removing Alpha Channel? - by david - 07-28-2022, 03:56 PM

Forum Jump: