Gimptalk - Premier Gimp Community: Problem with setting image opacity - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem with setting image opacity

#1 User is offline   kmdxb 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 20-December 11

Posted 20 December 2011 - 12:41 PM

I'm trying to simulate the effect you get by doing the following:

1) pressing CTRL+L (to open the layer window)
2) Changing the opacity to a new value (e.g. 50)
3) Closing the layer window again
4) Merge all visible layers

the result of which - so that the overall image opacity has been changed

No matter what combination of new layer/copy layer etc options I try, I just can't get the same effect. The merge-all-visible part is easy enough, it's getting the right layer/opacity that I am having problems with.

The images being used are png images that already have an alpha channel.



I've tried creating new layers from and copying image to layers, e.g.

(set! layer (car (gimp-layer-new image width height RGB-IMAGE "name" 40 NORMAL)))
(gimp-drawable-fill layer TRANSPARENT-FILL) ; tried things like BACKGROUND-FILL etc
(gimp-image-add-layer image layer -1)
(gimp-image-merge-visible-layers image 0)

and

(set! temp-layer (car (gimp-image-get-active-layer image)))
(set! layer (car (gimp-layer-copy temp-layer TRUE)))
(gimp-layer-set-opacity layer 40)
(gimp-image-add-layer image layer -1)
(gimp-image-merge-visible-layers image 0)


Any pointers as to the correct sequence to simulate the steps described above? I'm sure it must be a simple thing to do, but I just can't get it right!
0

#2 User is offline   kmdxb 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 20-December 11

Posted 20 December 2011 - 12:54 PM

Got it working now - always the way, just after you ask for help you figure it out...

Was trying to complicated an approach, it was actually just:

(set! layer (car (gimp-image-get-active-layer image)))
(gimp-layer-set-opacity layer 40)
(gimp-image-merge-visible-layers image 0)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic