It is currently Sat May 04, 2024 8:05 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: A script to calculate blur length on a shadow.
PostPosted: Tue Nov 12, 2013 3:49 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
For shadows with perspective is it possible to use a path line with three points to calculate the blur length at the end of a shadow to make it look blurry further back and gradually get solid and more realistic looking? This would allow you to have a custom blur for any shadow. The current Perspective shadow blurs the entire outside or radius of the shadow and doesn't look very real. Or am i missing a setting within the filter to fix that?

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


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: A script to calculate blur length on a shadow.
PostPosted: Tue Nov 12, 2013 12:17 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
I don't know of a way to do it as you describe, but what you seem to be requiring appears to be what the focus blur plug-in does.

You would have to create the Depth-Map manually, but then I suspect that the amount of blur is subjective anyway.

And apparently you don't need to be told where to find a copy of the plug-in ;)

Kevin


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Tue Nov 12, 2013 8:46 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Still looking for a technique for realistic shadows... Plain blur doesn't work because is expands the shadow, while the shadow get gradually thinner than the object that casts it.

_________________
Image


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Tue Nov 12, 2013 11:18 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Rod is this close to what you mean
Image

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


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Wed Nov 13, 2013 1:06 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12520
Now that's cool Graechan. Link to Script-fu? :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Wed Nov 13, 2013 1:35 am  (#6) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Lyle I'll post tomorrow but it's simple: 'perspective shadow' then add a white-mask on the shadow layer and blend with gradient FG/BG (black and white) from top to bottom on the mask.
Not sure if it's what Rod wanted though

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


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Wed Nov 13, 2013 6:15 am  (#7) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Now that is some shadow Graechan, I don't know how you did it but I would sure like to have it.

_________________
Image


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Wed Nov 13, 2013 7:11 am  (#8) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
This is what I would do:
Attachment:
blur_perspec_shadow.png
blur_perspec_shadow.png [ 20.87 KiB | Viewed 2974 times ]


Which is a perspective shadow, with a focus blur using a black to white gradient as a depth map to get the "deeper" areas increasingly blurred, then a layer mask using the same gradient to fade the shadow.

.xcf attached

Kevin

(actually what I would really do is use POV-Ray to render it properly ;) )


Attachments:
blur_perspec_shadow.xcf [269.57 KiB]
Downloaded 139 times
Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Wed Nov 13, 2013 7:22 am  (#9) 
Is it just me, or in Graechan's result does it not make the letter 'P' seem closer to the viewer than the other letters?


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Wed Nov 13, 2013 8:01 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Fluffybunny you are correct.
Thank you Kevin and Graechan that is almost perfect. Just needs more sharpness at the front of the shadow i think.

I was checking out the follow path plugin that was recently added to the registry.
http://registry.gimp.org/node/28647
I wonder if a blur option could be added to this filter as a option to gradually blur a perspective shadow? I asked the author to look into it.

_________________
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: A script to calculate blur length on a shadow.
PostPosted: Wed Nov 13, 2013 8:05 am  (#11) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
guess I just got n'jd. lol. I was looking for my post and wasn't there, Yes Fluffy I also agree that it looks closer but maybe it is because the tail on the p goes below the bottom of the other letters. Tjhe script is really looking good though.

_________________
Image


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Wed Nov 13, 2013 3:49 pm  (#12) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Here's what I get using POV-Ray

With a single point light source:
Attachment:
shadow_point.png
shadow_point.png [ 116.42 KiB | Viewed 1879 times ]


With an area light (14x14 point lights over a 2x2 area):
Attachment:
shadow_area.png
shadow_area.png [ 121.78 KiB | Viewed 1879 times ]

Some odd artefacts, but you get the idea.

Kevin


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Thu Nov 14, 2013 10:50 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
paynekj wrote:
Here's what I get using POV-Ray

With a single point light source:
Attachment:
shadow_point.png


With an area light (14x14 point lights over a 2x2 area):
Attachment:
shadow_area.png

Some odd artefacts, but you get the idea.

Kevin

Yep. The closer the shadow is to the object casting it the sharper it should be.

_________________
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: A script to calculate blur length on a shadow.
PostPosted: Thu Nov 14, 2013 2:33 pm  (#14) 
Offline
GimpChat Member

Joined: Oct 02, 2010
Posts: 106
I think that you can only fake because you need hight object distant for Light and angular of light for make real. The best would take render Model scene and work with photo as base. :)


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Thu Nov 14, 2013 2:38 pm  (#15) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Yes, the second one looks much more realistic. good job Kevin and Graechan for working out the kinks.

_________________
Image


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Thu Nov 14, 2013 7:42 pm  (#16) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
I think we all agree that the perspective shadow in Gimp falls slightly short of what we would like
below is simple solution for 2.6 and 2.8


Rel2 script below↓

Attachment:
Perspective Advanced.scm [5.53 KiB]
Downloaded 129 times

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


Last edited by Graechan on Fri Nov 15, 2013 10:46 pm, edited 2 times in total.

Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Thu Nov 14, 2013 8:03 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Haven't checked your script yet Graechan but this is a good gimp tutorial on creating realistic shadows
http://gimp.pixtuts.com/gimp-tutorials/ ... tic-shadow
Is it possible for you to make a script out of this?


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Thu Nov 14, 2013 8:15 pm  (#18) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
K1TesseraEna if you read the script then it's what I have done but thanks for sharing the tute

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


Top
 Post subject: Re: A script to calculate blur length on a shadow.
PostPosted: Fri Nov 15, 2013 3:17 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Graechan it seems to be in the menus as "<Image>/Filters/Light and Shadow/Perspective Advanced"

My settings
Image
My results
Image

Now i just need the lighting within the shadow. :) :bigthup
I will play around with it some more.

_________________
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: A script to calculate blur length on a shadow.
PostPosted: Fri Nov 15, 2013 3:50 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Here is the results after using your Perspective-Advanced script (same values).
Then i selected the bottle layer and ran Shadows&Highlights script on the bottle then using transform to correct the angle over the Perspective-Advanced shadow layer and voila. Oh i did have to create a new layer with a white shadow under all the other shadows.

Image

_________________
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 new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Drop Shadow help

6

No new posts Circular Motion Blur

2

No new posts Attachment(s) Gaussian blur not responding

7

No new posts Attachment(s) [solved] drop shadow around a selection

17

No new posts Attachment(s) Multiple Layer Shadow plugin

0



* Login  



Powered by phpBB3 © phpBB Group