It is currently Tue Jun 23, 2026 4:52 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 112 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Custom Shadow Procedure RC V0.3
PostPosted: Tue May 28, 2013 1:04 am  (#21) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Oregonian wrote:
Oh, I really like this script.

[ Image ]

Thanks, O! That is a cool font. What is it?

swathi wrote:
Hai
Can we do shadow like shown in the below image
thank you

That looks like an extruded shadow. I'll put that one the list for consideration, swathi. I might need to do a stand alone script for that. Maybe, I'll create two versions of this script, one like it stands now and another with gradient & extruded shadows.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Custom Shadow Procedure RC V0.3
PostPosted: Tue May 28, 2013 1:16 am  (#22) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
resizing the shadow layer as i showed does not resize the Image, it resizes the layer the layer in the same way as your
'merge visible layers' does but leaves the layers separate

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Custom Shadow Procedure RC V0.3
PostPosted: Tue May 28, 2013 1:55 am  (#23) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Ah, OK. if I understand what you are saying, I already do that on line 115, just after the canvas re-size.

(gimp-layer-resize-to-image-size shadow-layer) ; Layer to image size

That only happens if the user has selected to allow re-sizing.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Custom Shadow Procedure RC V0.3
PostPosted: Tue May 28, 2013 2:16 am  (#24) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
GnuTux that only takes affect if you allow image resizing, if you want 2 layers of equal size then you need to resize the layer where i showed as well

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: GC Shadow V0.3
PostPosted: Tue May 28, 2013 1:45 pm  (#25) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
I think I'll just leave it up to the user to decide if they want to resize. If they click off "Allow resizing", I've gotta assume there is a reason behind it. The new shadow layer will end up the same size as the selected layer.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Custom Shadow Procedure RC V0.3
PostPosted: Tue May 28, 2013 2:22 pm  (#26) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
GnuTux wrote:
Thanks, O! That is a cool font. What is it?
It is a font called, Whats Happened.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: GC Shadow V0.3
PostPosted: Tue May 28, 2013 2:26 pm  (#27) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Thanks. I grabbed it. :hehe

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 4:16 am  (#28) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
The script has been updated to RC V0.4 to correct a bug introduced in RC V0.3. The "Merge Visible Layers" option was throwing an error.

Thanks to Graechan for fully testing this script and bringing the problem to my attention.

The new version is posted on GIMP Scripts.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 9:26 am  (#29) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
v0.4

If I do the inner shadow first, re-activate the text layer and do the drop shadow, the drop shadow layer ends up above the text layer.

Doing the drop shadow first works fine, it goes below the text layer.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 7:09 pm  (#30) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Here I've done Inner shadow to text(with merge down), then drop shadow to text(with merge down),
then on on the background I've used inner-shadow and glow (with merge down), on all the shadows settings default

Image

the Image was done with a couple of minor tweaks to the script

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 7:25 pm  (#31) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
I like your results, Graechan. Adding merge (for the selected and new layer only) sounds like a useful option and will save you a couple of clicks.

I was getting ready to post the new version with the corrected layer positioning (issue O had pointed out) but I think I'll go ahead and add that merge option (for selected and new layers) before I release version V0.05.

Thanks!

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 7:32 pm  (#32) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
GnuTux wrote:
I was getting ready to post the new version with the corrected layer positioning but I think I'll go ahead and add that merge option (for selected and new layers) before I release version V0.05.

Currently your script does not behave properly for adding a shadow to a layer within a layergroup. Instead of using 'gimp-image-add-layer' to set an absolute position, you will need (well, want) to use 'gimp-image-insert-layer' with "0" for the parent and "-1" for the position. This will insert the new layer above the active layer in the layer stack and within the same group. You can then use 'gimp-image-lower-item' to position it beneath your original layer.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 7:51 pm  (#33) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Saulgoode I prefer to use this

(gimp-image-add-layer image newlayer (car (gimp-image-get-layer-position image oldlayer))) ;above

as it will add what is assigned as newlayer always above the whatever you assign as oldlayer

which in this case would be

(gimp-image-add-layer img shadow-layer (car (gimp-image-get-layer-position img in-layer)))

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 8:06 pm  (#34) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
'gimp-image-get-layer-position' retrieves the position of the layer within its layer group (if it's in a layergroup). 'gimp-image-add-layer' can only add a layer to the "top level" of an image's layerstack (i.e., it can not place the layer within any layergroup). Run GnuTux's script on a layer that is within a layergroup and you will see the shadow layer appears in the wrong place in the layer stack.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 8:11 pm  (#35) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
:lol I think that is kind of a saulgoode :ninja


Rather than having to merge down the inner shadow before making the drop shadow, I would like for the script to use the active text layer to make the drop shadow and have it go below the text layer.

I feel the script should use the active layer to do what the user wants.

Is it possible for the script to name the layer what the action was? That way layers can be rearranged more easily if necessary.

Inner shadow
Drop Shadow
Glow

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: GC Shadow V0.5
PostPosted: Wed May 29, 2013 8:12 pm  (#36) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
saulgoode wrote:
Currently your script does not behave properly for adding a shadow to a layer within a layergroup. Instead of using 'gimp-image-add-layer' to set an absolute position, you will need (well, want) to use 'gimp-image-insert-layer' with "0" for the parent and "-1" for the position. This will insert the new layer above the active layer in the layer stack and within the same group. You can then use 'gimp-image-lower-item' to position it beneath your original layer.

Interesting that you should post this because that is almost exactly what I did after O pointed out the layer positioning problem.

;
; Position shadow layer in tree
;
    (cond ((= inner-shadow-toggle TRUE)
            (set! inlayer-pos (car (gimp-image-get-item-position img in-layer)))
          )
          (else
            (set! inlayer-pos (+ (car (gimp-image-get-item-position img in-layer)) 1))
          )
    ) ;end cond

    (gimp-image-add-layer img shadow-layer inlayer-pos)   ; Add shadow layer to image

If you see any any thing else that can be improved, please let me know.

Thanks!

I've fixed the layer positioning logic, corrected an artifact bug when resizing layers and added an option to merge selected layer with shadow layer.

RC 0.5 is now up on GIMP scripts. :bigthup

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: GC Shadow V0.5
PostPosted: Wed May 29, 2013 8:21 pm  (#37) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
Ah! That's working better. I really do love the results of the script. It's very nice.

Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: GC Shadow V0.4
PostPosted: Wed May 29, 2013 8:24 pm  (#38) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Oregonian wrote:
Is it possible for the script to name the layer what the action was? That way layers can be rearranged more easily if necessary.

Inner shadow
Drop Shadow
Glow

I can certainly do that in this script and I can see how naming the layers in this manner might be better for the stand alone version.

One of the original reasons I wrote this script was to be able to pass the shadow name as an argument to a procedure. That's why you see the text entry area to specify the layer name within the script.

Looks like I have another option to add. :mrgreen:

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: GC Shadow V0.5
PostPosted: Thu May 30, 2013 12:48 am  (#39) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
GnuTux that can be done at the merge down point (it was among the changes I sent you)

    (if (= merge-visible-layers TRUE)               ; Check for merge layers flag
        (begin
           (set! shadow-layer (car (gimp-image-merge-down img shadow-layer 0)))  ; Merge Layers (expand as necessary)
         (gimp-layer-set-name shadow-layer (string-append layer-name "_" shadow-name))
        )
     ) ; endif

depending on what you enter for the shadow name will be added to you your layer name e.g. with a text layer named GIMP after giving it an "Inverted Glow" then a "Drop Shadow" my layer was named GIMP_Inverted-Glow_Drop-Shadow

I've amended the add layer code to

(gimp-image-insert-layer img shadow-layer
(car (gimp-item-get-parent in-layer))
(car (gimp-image-get-layer-position img in-layer))) ;above

this places the new layer above the 'in-layer' whether or not it's in a group but restricts the script to 2.8↑ upwards

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: GC Shadow V0.5
PostPosted: Thu May 30, 2013 1:17 am  (#40) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Saulgoode thank you for pointing out the fact that it's impossible to script effectively for 2.8 and 2.6 so I think that I'll have to leave 2.6 out for now

2.6 is starting to become a dinosaur (like me) anyway

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 112 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group