You are here

simple problem with edit-paste

Okay, I've searched and am a bit confused with the cut and paste within script-fu.
This is what I do manually.
From a loaded image.
Select all
paste into new image
scale to 200x150
flatten image
merge down
select all
resize image to 300x300
rotate layer -30 deg
rotate layer 30 deg
flatten image

-- Seems simple !

I tried with script-fu to automate, and I stuck at the paste

here is the scrip-fu as far as I got it.

(define (script-fu-logofromimage inImage inLayer )
(let (
(theImage 0)
(theLayer 0)
(theLayer2 0)
(gimp-image-undo-group-start inImage)
(gimp-selection-all inImage)
(set! theImage (car (gimp-image-duplicate inImage)) )
(set! theLayer (car (gimp-image-flatten theImage)))
(set! theLayer (car (gimp-image-scale theImage 200 150) ) )
(set! theLayer (car (gimp-image-flatten theImage)))
(script-fu-addborder theImage theLayer 10 10 '(200 200 200) 25 )
(set! theLayer (car (gimp-image-flatten theImage)))
(script-fu-drop-shadow theImage theLayer 8 8 15 '(0 0 0) 80 1 )
(set! theLayer (car (gimp-image-merge-down theImage theLayer 2)))
(gimp-selection-all theImage)
(gimp-edit-cut theLayer)
(set! theLayer (car (gimp-image-scale theImage 300 300)))
(set! theLayer2 (car (gimp-edit-paste theLayer FALSE)))

(begin (gimp-image-clean-all theImage)
(gimp-display-new theImage)
(gimp-selection-none inImage)
(gimp-image-undo-group-end inImage)
(gimp-displays-flush theImage)

I get "Error: Invalid type for argument 1 to gimp-edit-paste"

Im afraid im confused with drawables, layers and the image

Can anyone help me get further please.

'gimp-image-scale' does not return a useful value; you should not be assigning the result to 'theLayer'.

> Im afraid im confused with drawables, layers and the image

Layers are pixel maps representing graphical data in one of RGB, Grayscale, or Indexed color modes. A layer can be positioned anywhere relative to the image canvas.

A layer is a drawable, but GIMP has two other types of pixel maps which are also drawables: masks and channels.

A masks is a grayscale drawable attached to a particular layer and share that layer's position and dimensions.

Channels are grayscale drawables that always have the same position (origin at x=y=0) and dimensions as the image canvas.

An 'image' in GIMP parlance does not directly contain any graphical data. An image is an organized collection of layers, masks, and channels (plus entities such as paths, guides, and grids); along with some properties such as canvas dimensions, color mode, resolution, user units, etc.

Subscribe to Comments for "simple problem with edit-paste"