It is currently Tue Sep 22, 2026 3:55 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Adding text to imported gif
PostPosted: Sat Apr 01, 2017 12:18 pm  (#1) 
Offline
GimpChat Member

Joined: Apr 01, 2017
Posts: 15
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: New User



Hi everyone. I could use some help. I wanna to know how to take an imported gif, add a canvas to the left or to the bottom, make that bottom white, fill the white space with text, and save the imported gif so the words and the white area stay in place as the gif moves. thanks if you can help me. If you need an example of what i need i will provide one. thanks for anyone that's willing to help.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sat Apr 01, 2017 2:41 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16173
There is a script for this
combine OR overlay-background.
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.

; revised December 2010 to honor layer visibility

;; Combine each layer of the image with a copy of the background layer

(define (script-fu-sg-anim-combine-background image)
  ; get visible layers (bottom-to-top)
  (define (get-visibles image)
    (let loop ((layers (vector->list (cadr (gimp-image-get-layers image))))
               (visibles '()) )
      (if (null? layers)
        visibles
        (loop (cdr layers)
              (if (zero? (car (gimp-drawable-get-visible (car layers))))
                visibles
                (cons (car layers) visibles) ) ) ) ) )
               
  (gimp-image-undo-group-start image)
  (let* ((layers (vector->list (cadr (gimp-image-get-layers image))))
         (visibles (get-visibles image))
         (bg-layer (car (last layers)))
         (orig-sel (car (gimp-selection-save image))) )
    (gimp-selection-none image)
    (map (lambda (x) (gimp-drawable-set-visible x FALSE)) visibles)
    (when (= (car visibles) bg-layer)
      (set! visibles (cdr visibles))
      (gimp-drawable-set-visible bg-layer TRUE) )
    (while (pair? visibles)
      (let* ((layer (car visibles))
             (position (car (gimp-image-get-layer-position image layer)))
             (base-layer 0)
             (layer-name "") )
        (gimp-drawable-set-visible (car visibles) TRUE)
        (set! layer-name (car (gimp-drawable-get-name layer)))
        (set! base-layer (car (gimp-layer-new-from-drawable bg-layer image)))
        (gimp-image-add-layer image base-layer (+ position 1))
        (gimp-drawable-set-visible base-layer TRUE)
        (set! base-layer (car (gimp-image-merge-down image layer CLIP-TO-BOTTOM-LAYER)))
        (gimp-drawable-set-name base-layer layer-name) )
      (set! visibles (cdr visibles)) )
    (gimp-selection-load orig-sel)
    (gimp-image-remove-channel image orig-sel) )
  (gimp-image-undo-group-end image)
  (gimp-displays-flush)
  )

(script-fu-register "script-fu-sg-anim-combine-background"
  "<Image>/Filters/Animation/_Combine background"
  "Combine each layer of the image with a copy of the background layer"
  "Saul Goode"
  "Saul Goode"
  "4/22/2007"
  "*"
  SF-IMAGE    "Image"    0
  )

;; Overlay each layer of the image with a copy of the background layer

(define (script-fu-sg-anim-overlay-background image)
  ; get visible layers (bottom-to-top)
  (define (get-visibles image)
    (let loop ((layers (vector->list (cadr (gimp-image-get-layers image))))
               (visibles '()) )
      (if (null? layers)
        visibles
        (loop (cdr layers)
              (if (zero? (car (gimp-drawable-get-visible (car layers))))
                visibles
                (cons (car layers) visibles) ) ) ) ) )
  (gimp-image-undo-group-start image)
  (let* ((layers (vector->list (cadr (gimp-image-get-layers image))))
         (visibles (get-visibles image))
         (bg-layer (car (last layers)))
         (orig-sel (car (gimp-selection-save image))) )
    (gimp-selection-none image)
    (map (lambda (x) (gimp-drawable-set-visible x FALSE)) visibles)
    (when (= (car visibles) bg-layer)
      (set! visibles (cdr visibles))
      (gimp-drawable-set-visible bg-layer TRUE) )
    (while (pair? visibles)
      (let* ((layer (car visibles))
             (position (car (gimp-image-get-layer-position image layer)))
             (over-layer 0) )
        (gimp-drawable-set-visible layer TRUE)
        (gimp-image-set-active-layer image layer)
        (set! over-layer (car (gimp-layer-new-from-drawable bg-layer image)))
        (gimp-image-add-layer image over-layer -1)
        (gimp-drawable-set-visible over-layer TRUE)
        (gimp-image-merge-down image over-layer EXPAND-AS-NECESSARY) )
      (set! visibles (cdr visibles)) )
    (gimp-selection-load orig-sel)
    (gimp-image-remove-channel image orig-sel) )
  (gimp-image-undo-group-end image)
  (gimp-displays-flush)
  )

(script-fu-register "script-fu-sg-anim-overlay-background"
  "<Image>/Filters/Animation/_Overlay background"
  "Overlay each layer of the image with a copy of the background layer"
  "Saul Goode"
  "Saul Goode"
  "4/22/2007"
  "*"
  SF-IMAGE    "Image"    0
  )


Save it to your scripts folder as sg-anim-combine-background.scm.
You will find it in the menu location Filters>Animation>Overlay Background
There is also a Filters>Animation>Combine Background included within the script. =)

Just throw in a text layer and run overlay bg. Make sure the text layer is the bottom most layer.

_________________
Image


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Mon Apr 03, 2017 7:12 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jul 24, 2016
Posts: 43
Thanx for this scrips rod I'm sure it will come in very handy. Image


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Mon Apr 03, 2017 7:56 am  (#4) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16173
Bob Albion wrote:
Thanx for this scrips rod I'm sure it will come in very handy. [ Image ]

Thank Saulgoode. The author of the script. =)

_________________
Image


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 11:38 am  (#5) 
Offline
GimpChat Member

Joined: Apr 01, 2017
Posts: 15
okay i've done all that and it works so far so thank you. now when i try to export it as a gif file the image stays on the first frame. is there a way to keep it animated that i'm missing?


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 12:26 pm  (#6) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14206
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
LazyNinjas wrote:
okay i've done all that and it works so far so thank you. now when i try to export it as a gif file the image stays on the first frame. is there a way to keep it animated that i'm missing?

After using the script,
to overlay/combine the bottom most layer to all the other layers.

You should also delete the bottom layer,
which was used to overlay/combine into your image.

If you don't remove this layer.
It will remain as part of the animation when exported
.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 12:45 pm  (#7) 
Offline
GimpChat Member

Joined: Apr 01, 2017
Posts: 15
Removed the layer and still stuck on first image.

here is an example of what i'm trying to make in case it's needed



http://imgur.com/TZLaRxK


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 12:54 pm  (#8) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14206
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
LazyNinjas wrote:
Removed the layer and still stuck on first image.

here is an example of what i'm trying to make in case it's needed



http://imgur.com/TZLaRxK


You must make sure that the image is being exported as a .gif.

If you export an image with the file extension of .gif.
The Export as gif dialog should pop up.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 12:57 pm  (#9) 
Offline
GimpChat Member

Joined: Apr 01, 2017
Posts: 15
okay let's stay on this post.

http://i.imgur.com/1FtXATc.png this is the screen i get to pop up when i export as gif


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 1:09 pm  (#10) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14206
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
LazyNinjas wrote:
okay let's stay on this post.

http://i.imgur.com/1FtXATc.png this is the screen i get to pop up when i export as gif

Are you using this option to export your image?
If not,
what export option are you using?

Image

Also,
I have never seen the export dialog you've referred to,
when exporting an image as a .gif.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 1:14 pm  (#11) 
Offline
GimpChat Member

Joined: Apr 01, 2017
Posts: 15
i only have an "export" option. I don't have an export as. in fact my gimp looks nothing like the one u have. is that an updated version?


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 1:20 pm  (#12) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14206
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
LazyNinjas wrote:
i only have an "export" option.
I don't have an export as.
in fact my gimp looks nothing like the one u have.
is that an updated version?

I have Gimp 2.8.16 installed and I'm using the theme Aurora-Midnight.

You can find out what Gimp you're running,
by going to,
Help>About GIMP.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 1:25 pm  (#13) 
Offline
GimpChat Member

Joined: Apr 01, 2017
Posts: 15
i had 2.8.0


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 2:14 pm  (#14) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2615
LazyNinjas wrote:
Removed the layer and still stuck on first image.

here is an example of what i'm trying to make in case it's needed



http://imgur.com/TZLaRxK


You got it figured out - that is good :)

looking at your posts, that broken gif export dialog can happen if the file plug-in-file-gif.ui is missing (or has been moved)

screenshot: http://i.imgur.com/94LKEsb.jpg

And you might as well have this video I just knocked out - adding text to the side of a gif. Uses the script that Rod provided.

https://youtu.be/RGrJSnYQ_OM duration 3 minutes


Top
 Post subject: Re: Adding text to imported gif
PostPosted: Sun Apr 09, 2017 3:55 pm  (#15) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
LazyNinjas wrote:
okay let's stay on this post.

http://i.imgur.com/1FtXATc.png this is the screen i get to pop up when i export as gif


Your Gimp install is damaged. If you try to export to PNG, you will get the same dialog. The content of these dialogs come from the files:
usr/share/gimp/2.0/ui/plug-ins/plug-in-file-gif.ui
usr/share/gimp/2.0/ui/plug-ins/plug-in-file-png.ui

They may be missing/renamed/disabled by some security software.

If you are computer savvy they aren't are to transpalnt from another working installaiton of Gimp, otherwise you have better reinstall. If they are still missing then you should really look into the logs of whatever security software you have.

_________________
Image


Top
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group