: GIMP How to make existing gif background transparent I have the following gif, how to make the grey background transparent if not white?
I have the following gif, how to make the grey background transparent if not white?
More posts by @Kimberly620
4 Comments
Sorted by latest first Latest Oldest Best
It depends if the light gray things are shadows or not.
They are shadows
Then a transparent background is not doable for this particular GIF. When you want a transparent background, you want to be able to show the picture over any background. In the picture above the shadows would be implemented as partially opaque pixels, that would slightly darken the pixels of the background. But in a GIF, there are no partially opaque pixels, they are fully opaque or fully transparent, so you can't have shadows. You can however change the background:
Prerequisites: Download and install:
Color to Alpha All Layers script
interleave-layers
Then:
* Remove the optimizations: Filters>Animation>Unoptimize. This create a new image, you can close the source one.
* Change image to full RGB: Image>Mode>RGB
* Colors>Color to Alpha All layers and remove the background (color-pick, it should be #EEEEEE ). Dark grey can darken to black, but don't panic.
* Add a layer filled with white (or your new background color). Make it invisible
* Image>Interleave layers>Interleave single layer (sprite mode) and select the white layer. This will create a new image, use Filters>Animation>Playback to check it.
* Filters>Animation>Optimize (for GIF)
* Export as GIF, don't forget to tick the animation checkbox, and to force all frames to 40ms (the optimization sets a longer interval)
They aren't shadows
So the light gray things will remain opaque, and we want to remove the background but prevent Color-to-alpha to change the light gray things into be partially opaque pixels. For a single layer, that means Select the background,Select>Growby two pixels, andColors>Color to Alpha` but this will be long for 68 layers. However there is a script that makes this a bit faster if used right:
Prerequisites: Download and install:
ofn-erase-background
Remove the optimizations: Filters>Animation>Unoptimize. This create a new image, you can close the source one.
Change image to full RGB: Image>Mode>RGB
Set Gimp background color from the background color of your image (#eeeeee)
Set the tools to the "By Color" selector.
Click in a corner of the top layer, this should select the background
Layer>Erase background should make the background transparent.
Warm your fingers and do 67 times:
Click a layer in the Layer list
Clear near a corner in the image
Ctr-F to reexecute Layer>Erase background
Filters>Animation>Playback to check
Filters>Animation>Optimize (for GIF)
Export as GIF, don't forget to tick the animation checkbox, and to force all frames to 40ms (the optimization sets a longer interval)
Open the GIF in GIMP, and click Filter > Animation > Unoptimise. This will make the following tasks a bit easier.
Go through each layer starting with the top one.
With the Select by Color tool, select the grey background. Note: you may have to adjust the Threshold setting in the tool options to get a good selection.
Press Delete
Hide the layer in the layers panel by clicking the eye icon next to it
Select the layer underneath
Repeat steps 1 to 4 for every layer. There are 68 frames, so it shouldn't take too long.
If you want you can crop the image a bit with the crop tool, to save all the wasted space, and keep your file size down a bit
When you have finished, click File > Export As, choose GIF as the file type, and hit Export
When the GIF Export dialog opens, choose all the settings as below. Note the delay shown is the same delay as the original GIF.
I'm thinking maybe something like Online image editor would be good enough for this.
The transparency removal page is behind the Wizards tab.
They have a tutorial on this too
For a Gimp
Right click the image and go to LAYERS then ADD ALPHA CHANNEL. This create the transparency beneath all layers you will have.
Right click on the image again and go to SELECT --> BY COLOR. Click on the color in the image you want to remove.
With right click to EDIT --> CLEAR.
Save as GIF.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.