It is currently Sat Jul 20, 2024 10:18 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 5:21 am  (#1) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
That could distort an image based on a height map?

I'll explain with a few images what I mean.

Say that I have this image:

Image

And I would apply this height map to it:

Image

Then it would distort it to something like this:

Image

So basically, the script would take the height map, and distort the image according to the information in the height map... the higher the value of a pixel in the height map, the more grow/bulge would be applied to the corresponding pixel in the image.

This would be really useful to me... Anyone know if something like this exists? If not... I might have a few ideas how to make it work, although I'm not sure how feasible they are...


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: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 5:38 am  (#2) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
The fish-eye filter in gmic > deformations does a similar thing but it make a gloppy center.

I like the one you did much better.

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


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 6:16 am  (#3) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
The standard displacement filter gives this:

Image

using these displacement maps:

Image

You will need to play with the displacement maps to see if you can get the shape you are looking for. All of the details for the maps are in the corner documentation block. (It's a file from when I was testing it last summer.)

There was a thread about this last summer. I think it was on this forum.

_________________
Image


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 9:05 am  (#4) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
bkh1914 wrote:
The standard displacement filter gives this:


You can generate displacement maps from your heightfield using the emboss filter:
Attachment:
2011-08-09_095321.jpg
2011-08-09_095321.jpg [ 70.64 KiB | Viewed 3609 times ]


Just duplicate the hf and emboss it once as shown then again at and Azimuth of 90 degrees. These then are the X and Y inputs for your heightfield.

Note that you need to heavily blur the results of the emboss filter to get rid of all the 8 bit artifacting from the heightfiled gradient you provided before displacing.

here is my result:
Attachment:
dispalce.jpg
dispalce.jpg [ 83.32 KiB | Viewed 3609 times ]


Having the gridline centered on the dispalce was less than optimal :)

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 12:11 pm  (#5) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Thanks guys. It works like a charm.


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 12:17 pm  (#6) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
dd, just curious, which method did you use out of the 3?

_________________
Image


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 1:38 pm  (#7) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
The third one, RobA:s. It was the most optimal for my purposes since I needed to get the displacement to follow a very specific shape.


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 3:00 pm  (#8) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Well I tried to do it and I can't figure it out at all. It is as clear as mud. I kind of liked the effect.

_________________
Image


Last edited by molly on Tue Aug 09, 2011 6:33 pm, edited 1 time in total.

Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 09, 2011 4:00 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Apr 09, 2011
Posts: 1764
nifty!


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Sun Aug 21, 2011 2:17 pm  (#10) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Ok, getting back to this... the method described here works pretty well for layers that have lots of transparency and only sparce objects here and there... but for flat, solid surface layers, it doesn't perform that well, since the pixels are moved away from one spot and that spot gets blurred by the mapping.

So I wonder if it would be possible somehow to render a voxel landscape based on the height map, colour that landscape with the corresponding pixel values of another layer, then shine a light on it and view it from top-down... does anyone know how to go about doing this?

Failing that... I've been wondering about another method. It would involve taking the height map, and dividing it into 255 layer masks, each based on a height value - for example, layer mask 0 would contain all the pixels with value 0 from the height map, and so on. Then take 255 copies of the layer, and mask each of them with the corresponding layer mask. Then scale them up incrementally, so that the first one wouldn't be scaled at all, and the last would be enlargened the most.

To make this work a bit smoother, the height map could be posterized to have less values, so you would need less layer masks and layer copies. I'm not sure if this would work in practice, though...


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Mon Aug 22, 2011 2:35 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14715
Location: USA
I wonder if this could be done with a text layer?
So you could get that effect of part of a man coming out of the text?
Like say his arm to hug something or someone.

_________________
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: Does anyone know of a script or plugin....
PostPosted: Mon Aug 22, 2011 3:06 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14715
Location: USA
Didn't work too well for me with lens distortion.
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 subject: Re: Does anyone know of a script or plugin....
PostPosted: Mon Aug 22, 2011 3:51 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14715
Location: USA
A bit better using the displace filter and then placing the displaced text in from of the original text. :)
Getting there.

Image

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 subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 23, 2011 1:44 pm  (#14) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Quote:
So I wonder if it would be possible somehow to render a voxel landscape based on the height map, colour that landscape with the corresponding pixel values of another layer, then shine a light on it and view it from top-down... does anyone know how to go about doing this?


I'd use a raytracer - POVray can do this really easily.

Otherwise you could try lighting effects. Specify a bump map and a light source...

Can you provide an example of what the result should be like? I have a hard time with your description.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Last edited by RobA on Sat Aug 27, 2011 5:25 pm, edited 1 time in total.

Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 23, 2011 2:58 pm  (#15) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Quote:
Can you provide an example of what the result should be like? I have a hard time with your description.


In my first post...


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Sat Aug 27, 2011 6:19 pm  (#16) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
dd wrote:
Quote:
Can you provide an example of what the result should be like? I have a hard time with your description.


In my first post...


I'm confused as that does not match you description... you wanted "a voxel landscape based on the height map, colour that landscape with the corresponding pixel values of another layer, then shine a light on it and view it from top-down..."

Which in my mind is more like this:
Attachment:
test.jpg
test.jpg [ 127.2 KiB | Viewed 1548 times ]


-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Mon Aug 29, 2011 2:38 pm  (#17) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Quote:
I'm confused as that does not match you description... you wanted "a voxel landscape based on the height map, colour that landscape with the corresponding pixel values of another layer, then shine a light on it and view it from top-down..."


Well if you could align the landscape so that each voxel would be one pixel in size, so that effectively, with a flat height map, the resulting image would be the same as the original... Then with a non-flat height map, there would be bulges in it. Sorry, I can't explain it any better.


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Mon Aug 29, 2011 4:19 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 225
Maybe you want to check out Displace or Normalmap plugins. Both can be mis-used very coolly. I just mangled basic grid with tech texture using Displace.

If you want real-looking (but fake) voxels, Blender can help. Either get Freestyle-compilation of it or then use more modest edge rendering in official version.

No, I don't have very easy way to suggest, these are... cumbersome methods.


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Mon Aug 29, 2011 4:37 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 225
Image

Five minute example with official Blender 2.59...

But still cumbersome, if you need to learn it. :hehe


Top
 Post subject: Re: Does anyone know of a script or plugin....
PostPosted: Tue Aug 30, 2011 5:28 pm  (#20) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
I have blender installed, I just don't really have time to learn to use it...

As for the displace filter, like said earlier in the thread, it works pretty well for images that have lots of transparency, like grids and such... but not so well for solid surfaces.


Top
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Looking for the Text Stamp Plugin/Script

4

No new posts Plugin or Script to bend/curve text

17

No new posts Script passes a 0 to the Displace plugin, and apparently it's an issue

0

No new posts Attachment(s) Calendar month and year plugin (script .scm) updated - modified

12

No new posts Attachment(s) Looking for "Supernova" Script/Plugin

8



* Login  



Powered by phpBB3 © phpBB Group