Gimp-Forum.net
How to make a GIF with a transparent background? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: How to make a GIF with a transparent background? (/Thread-How-to-make-a-GIF-with-a-transparent-background)

Pages: 1 2


RE: How to make a GIF with a transparent background? - iZeus - 05-29-2017

(05-25-2017, 07:34 PM)Ofnuts Wrote: hmmm. The thinf you posted on Imgur (you also asked on reddit) got changed into a video by Imgur. And there is no transparency on videos, so the white background can have been added by Imgur.

Hey, Ofnuts

Not sure if you meant me but, the background was there before I uploaded to Imgur or any other forum.

Took the image off the net -> Uploading into GIMP -> Added Alpha Channel to all layers -> Removed the background -> In GIMP is plays perfectly with a transparent background -> I Export it -> Has a white background in output file.

(05-25-2017, 04:37 PM)rich2005 Wrote: Open the gif in Gimp and check that you have transparency

It is probably the 'tool' you are using to view the gif I use linux so I do not have those you referenced

exanple: nview on the left does not show transparency (shows white) Same image and viewnior on right does.
Some web browsers can be the same, Firefox shows white, Slimjet shows a checker pattern.

Hey, Rich

Fair enough with the tools but the photo viewing application I'm using wouldn't show a background if it was transparent, however it's transparent in GIMP and in the GIMP play back the output file, however, is not.


RE: How to make a GIF with a transparent background? - Ofnuts - 05-29-2017

(05-29-2017, 08:09 PM)iZeus Wrote:
(05-25-2017, 07:34 PM)Ofnuts Wrote: hmmm. The thinf you posted on Imgur (you also asked on reddit) got changed into a video by Imgur. And there is no transparency on videos, so the white background can have been added by Imgur.

Hey, Ofnuts

Not sure if you meant me but, the background was there before I uploaded to Imgur or any other forum.

Took the image off the net -> Uploading into GIMP -> Added Alpha Channel to all layers -> Removed the background -> In GIMP is plays perfectly with a transparent background -> I Export it -> Has a white background in output file.

(05-25-2017, 04:37 PM)rich2005 Wrote: Open the gif in Gimp and check that you have transparency

It is probably the 'tool' you are using to view the gif I use linux so I do not have those you referenced

exanple: nview on the left does not show transparency (shows white) Same image and viewnior on right does.
Some web browsers can be the same, Firefox shows white, Slimjet shows a checker pattern.

Hey, Rich

Fair enough with the tools but the photo viewing application I'm using wouldn't show a background if it was transparent, however it's transparent in GIMP and in the GIMP play back the output file, however, is not.

Can you attach the XCF (or the XCFGZ)? (up to 2MB, so if the XCF is 6MB, saving to XCFGZ will likely compress it enough to be accepted here). Otherwise putting it on a decent file sharing site (DropBox or else) is a solution.


RE: How to make a GIF with a transparent background? - iZeus - 05-29-2017

(05-29-2017, 09:12 PM)Ofnuts Wrote:
(05-29-2017, 08:09 PM)iZeus Wrote:
(05-25-2017, 07:34 PM)Ofnuts Wrote: hmmm. The thinf you posted on Imgur (you also asked on reddit) got changed into a video by Imgur. And there is no transparency on videos, so the white background can have been added by Imgur.

Hey, Ofnuts

Not sure if you meant me but, the background was there before I uploaded to Imgur or any other forum.

Took the image off the net -> Uploading into GIMP -> Added Alpha Channel to all layers -> Removed the background -> In GIMP is plays perfectly with a transparent background -> I Export it -> Has a white background in output file.

(05-25-2017, 04:37 PM)rich2005 Wrote: Open the gif in Gimp and check that you have transparency

It is probably the 'tool' you are using to view the gif I use linux so I do not have those you referenced

exanple: nview on the left does not show transparency (shows white) Same image and viewnior on right does.
Some web browsers can be the same, Firefox shows white, Slimjet shows a checker pattern.

Hey, Rich

Fair enough with the tools but the photo viewing application I'm using wouldn't show a background if it was transparent, however it's transparent in GIMP and in the GIMP play back the output file, however, is not.

Can you attach the XCF (or the XCFGZ)? (up to 2MB, so if the XCF is 6MB, saving to XCFGZ will likely compress it enough to be accepted here). Otherwise putting it on a decent file sharing site (DropBox or else) is a solution.

Sure, give me a while doing a design at the moment and I'd have to re-do the project because I don't think I can find the GIMP file.


RE: How to make a GIF with a transparent background? - iZeus - 05-30-2017

(05-29-2017, 09:12 PM)Ofnuts Wrote:
(05-29-2017, 08:09 PM)iZeus Wrote:
(05-25-2017, 07:34 PM)Ofnuts Wrote: hmmm. The thinf you posted on Imgur (you also asked on reddit) got changed into a video by Imgur. And there is no transparency on videos, so the white background can have been added by Imgur.

Hey, Ofnuts

Not sure if you meant me but, the background was there before I uploaded to Imgur or any other forum.

Took the image off the net -> Uploading into GIMP -> Added Alpha Channel to all layers -> Removed the background -> In GIMP is plays perfectly with a transparent background -> I Export it -> Has a white background in output file.

(05-25-2017, 04:37 PM)rich2005 Wrote: Open the gif in Gimp and check that you have transparency

It is probably the 'tool' you are using to view the gif I use linux so I do not have those you referenced

exanple: nview on the left does not show transparency (shows white) Same image and viewnior on right does.
Some web browsers can be the same, Firefox shows white, Slimjet shows a checker pattern.

Hey, Rich

Fair enough with the tools but the photo viewing application I'm using wouldn't show a background if it was transparent, however it's transparent in GIMP and in the GIMP play back the output file, however, is not.

Can you attach the XCF (or the XCFGZ)? (up to 2MB, so if the XCF is 6MB, saving to XCFGZ will likely compress it enough to be accepted here). Otherwise putting it on a decent file sharing site (DropBox or else) is a solution.

https://www.dropbox.com/s/crf9vup2j0kh0bi/SpiralFailGif.xcf?dl=0


RE: How to make a GIF with a transparent background? - rich2005 - 05-30-2017

@iZeus

Quote:...the photo viewing application I'm using wouldn't show a background if it was transparent, however it's transparent in GIMP and in the GIMP play back the output file, however, is not.

I can not reproduce that last bit . Transparency shows in the Gimp editor and also the Gimp animation playback window.

A couple of minutes video with some comments https://youtu.be/z3-p3ncP_qk


RE: How to make a GIF with a transparent background? - Ofnuts - 05-30-2017

A ZIP with:

* A GIF exported from your XCF
* A checkerboard pattern background
* A HTML file to play the first over the second in your browser

https://www.dropbox.com/s/x87m65kf08sgl9a/spiral.zip?dl=0

The whole thing works. So the next step is to try with the GIF you exported.

Btw, you have an extra black background frame that you may want to remove, and you should really be using "replace" mode.


RE: How to make a GIF with a transparent background? - iZeus - 05-31-2017

(05-30-2017, 08:53 AM)rich2005 Wrote: @iZeus

Quote:...the photo viewing application I'm using wouldn't show a background if it was transparent, however it's transparent in GIMP and in the GIMP play back the output file, however, is not.

I can not reproduce that last bit . Transparency shows in the Gimp editor and also the Gimp animation playback window.

A couple of minutes video with some comments https://youtu.be/z3-p3ncP_qk

Hey, Rich,

I had to listen to the video at least 5 times. Your voice is just absolutely amazing I couldn't believe it. Should be on Television or Radio or even acting!
Appreciate the video, I understand what you're saying, as it relates to the transparency being affected by different applications, unfortunately for me, After Effects doesn't show it's transparency, ah well. You win some, you lose some.

Thanks for the help, Rich and your valuable time, I appreciate it!

(05-30-2017, 09:49 AM)Ofnuts Wrote: A ZIP with:

* A GIF exported from your XCF
* A checkerboard pattern background
* A HTML file to play the first over the second in your browser

https://www.dropbox.com/s/x87m65kf08sgl9a/spiral.zip?dl=0

The whole thing works. So the next step is to try with the GIF you exported.

Btw, you have an extra black background frame that you may want to remove, and you should really be using "replace" mode.

Hey, Ofnuts

Thanks for your help, from Rich's video it seems it shows up differently using different applications, in GIMP it's transparent and in other applications it's solid.
The replace mode, I've read up just now it replaces pixels of one colour with another, where exactly should I have done that in this GIF as opposed to what?


RE: How to make a GIF with a transparent background? - rich2005 - 05-31-2017

Quote:Appreciate the video, I understand what you're saying, as it relates to the transparency being affected by different applications, unfortunately for me, After Effects doesn't show it's transparency, ah well. You win some, you lose some.

Really there is no such thing as a transparent pixel. The transparency, the alpha channel is a mask which lets an application, a viewer or a browser show some graphic underneath. Nothing underneath, then a common way of depicting it is that checker board pattern. But it might also be just white or black, So whatever the alpha channel will still be there. see: https://en.wikipedia.org/wiki/Alpha_compositing

Last time I used anything Adobe for video (premier) was about 2000, so I do not know After Effects at all. However when it comes to transparency, video is even more picky than graphics for web use. It is very much a mask to determine what shows through.

Quote:..The replace mode, I've read up just now it replaces pixels of one colour with another, where exactly should I have done that in this GIF as opposed to what?

Ofnuts will expand but that is not as I understand it. For an animated gif replace mode does just that each frame (layer) needs to be solid and is played one after another, each frame replacing the last.

The alternative is combine when an animated gif is optimized and identical parts of each frame are removed to save file size. When played the layers join together to form a complete image.

That is why your xcf file for editing, should have been unoptimized, colour to RGB, and replace mode used.

Does that make sense, do not worry about it, keep experimenting.


RE: How to make a GIF with a transparent background? - Ofnuts - 05-31-2017

(05-31-2017, 07:47 PM)iZeus Wrote: Thanks for your help, from Rich's video it seems it shows up differently using different applications, in GIMP it's transparent and in other applications it's solid.
Yes, and the purpose of that little zip is to demonstrate to you that it works in your browser when you control everything, so that the problem is really with other software (or the website re-processing).

(05-31-2017, 07:47 PM)iZeus Wrote: The replace mode, I've read up just now it replaces pixels of one colour with another, where exactly should I have done that in this GIF as opposed to what?
No, it's something different here. In a GIF, the frames can be cumulative (what is show for frame N+1 is whatever you see on frame N plus some new frame overlaid over it (this overlay can be (and usually is partial), this is the "combine" mode, or not; frame N+1 totally replaces frame N (this is the "replace" mode).


RE: How to make a GIF with a transparent background? - iZeus - 06-03-2017

(05-31-2017, 08:27 PM)rich2005 Wrote:
Quote:Appreciate the video, I understand what you're saying, as it relates to the transparency being affected by different applications, unfortunately for me, After Effects doesn't show it's transparency, ah well. You win some, you lose some.

Really there is no such thing as a transparent pixel. The transparency, the alpha channel is a mask which lets an application, a viewer or a browser show some graphic underneath. Nothing underneath, then a common way of depicting it is that checker board pattern. But it might also be just white or black, So whatever the alpha channel will still be there. see: https://en.wikipedia.org/wiki/Alpha_compositing

Last time I used anything Adobe for video (premier) was about 2000, so I do not know After Effects at all. However when it comes to transparency, video is even more picky than graphics for web use. It is very much a mask to determine what shows through.

Quote:..The replace mode, I've read up just now it replaces pixels of one colour with another, where exactly should I have done that in this GIF as opposed to what?

Ofnuts will expand but that is not as I understand it. For an animated gif replace mode does just that each frame (layer) needs to be solid and is played one after another, each frame replacing the last.

The alternative is combine when an animated gif is optimized and identical parts of each frame are removed to save file size. When played the layers join together to form a complete image.

That is why your xcf file for editing, should have been unoptimized, colour to RGB, and replace mode used.

Does that make sense, do not worry about it, keep experimenting.

Hey, Rich.

It did make sense, you're saying if combine is used, identical frames would be removed and thus playback wouldn't be as smooth but replace uses all the frames.

(05-31-2017, 08:31 PM)Ofnuts Wrote:
(05-31-2017, 07:47 PM)iZeus Wrote: Thanks for your help, from Rich's video it seems it shows up differently using different applications, in GIMP it's transparent and in other applications it's solid.
Yes, and the purpose of that little zip is to demonstrate to you that it works in your browser when you control everything, so that the problem is really with other software (or the website re-processing).

(05-31-2017, 07:47 PM)iZeus Wrote: The replace mode, I've read up just now it replaces pixels of one colour with another, where exactly should I have done that in this GIF as opposed to what?
No, it's something different here. In a GIF, the frames can be cumulative (what is show for frame N+1 is whatever you see on frame N plus some new frame overlaid over it (this overlay can be (and usually is partial), this is the "combine" mode, or not; frame N+1 totally replaces frame N (this is the "replace" mode).
Hey, Ofnuts

So combine is new layer on top of an old layer repeatedly but replace replaces each frame. I believe I understand the formula here, thank you!