RSS/Atom feed Twitter
Site is read-only, email is disabled

How to use gimp-layer-set-opacity in batch mode?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

How to use gimp-layer-set-opacity in batch mode? Klaus Schmidinger 22 Jun 10:42
  How to use gimp-layer-set-opacity in batch mode? saulgoode@brickfilms.com 22 Jun 12:00
   How to use gimp-layer-set-opacity in batch mode? Klaus Schmidinger 22 Jun 13:03
Klaus Schmidinger
2006-06-22 10:42:40 UTC (almost 18 years ago)

How to use gimp-layer-set-opacity in batch mode?

Assume there is an image file named "test.png" that contains some drawing with an alpha channel. The alpha channel is used to create an empty (fully transparent) background, while the foreground drawing is completely opaque.

What I want to do is to make the foreground drawing 50% transparent. In order to do so, I use the following script:

---------------------- cut -------------------------------------- #!/bin/sh

gimp -i -b - <

So what exactly am I doing wrong here?

Any help would be greatly appreciated.

Klaus Schmidinger

saulgoode@brickfilms.com
2006-06-22 12:00:11 UTC (almost 18 years ago)

How to use gimp-layer-set-opacity in batch mode?

Quoting Klaus Schmidinger :

"GIMP: Not enough visible layers for a merge. There must be at least two."

The CVS version of the GIMP permits "merging" a single layer. If you are unable to get the CVS version, you can try the following approach which applies a 50% (GRAY) mask to the layer.

------- (let* (
(image (car (gimp-file-load 1 "test.png" "test.png"))) (drawable (car (gimp-image-get-active-layer image))) (mask (car (gimp-layer-create-mask drawable ADD-WHITE-MASK)))) (gimp-layer-add-mask drawable mask) (gimp-brightness-contrast mask -127 0) (gimp-image-remove-layer-mask image drawable MASK-APPLY)

(gimp-file-save RUN-NONINTERACTIVE image drawable "test-50.png" "test-50.png")
(gimp-quit 0)
)

Klaus Schmidinger
2006-06-22 13:03:01 UTC (almost 18 years ago)

How to use gimp-layer-set-opacity in batch mode?

saulgoode@brickfilms.com wrote:

Quoting Klaus Schmidinger :

"GIMP: Not enough visible layers for a merge. There must be at least two."

The CVS version of the GIMP permits "merging" a single layer. If you are unable to get the CVS version, you can try the following approach which applies a 50% (GRAY) mask to the layer.

Thanks a lot - works like a charm!

Klaus Schmidinger