It is currently Sat Jun 29, 2024 11:22 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Gimp Help
PostPosted: Sat Apr 01, 2017 12:16 pm  (#1) 
Offline
GimpChat Member

Joined: Apr 01, 2017
Posts: 15
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: Gimp Help
PostPosted: Sun Apr 02, 2017 5:47 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
LazyNinjas wrote:
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.

Thought i already answered this but i may have closed before saving my response. :lol
Anyways try the attached script.
; 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 in your /.gimp-2.8/scripts folder as "sg-anim-overlay-background.scm" and go to Filters>Script-Fu>Refresh Scripts - you will then find it here
Filters/Animation/_Overlay background

TO USE:
1) Open your GIF
2) Create a new TEXT layer where you want it to show in the GIF - place it on the bottom of the layer stack
3) Run the overlay bg script option
4) Run Filters>Animation>Play Back to check

There is also an option added to COMBINE bg to each layer.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Gimp Help
PostPosted: Wed May 10, 2017 7:24 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
That script works great, thanks Rod. I was looking for those functions, but couldn't find them.....


Top
 Post subject: Re: Gimp Help
PostPosted: Thu May 11, 2017 6:17 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
racer-x wrote:
That script works great, thanks Rod. I was looking for those functions, but couldn't find them.....

Your welcome for the script but i did not write it. This is a script written by Saulgoode hence (sg). =)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Gimp Help
PostPosted: Thu May 11, 2017 4:14 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
Do you know if exists a script that will export all layers as image sequence named numerically like: 001.png, 002.png, 003.png and so on?

**Edit: Never mind, This one works just fine: download/file.php?id=29367


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group