Results 1 to 3 of 3

Thread: High Pass Filter in GIMP (new plugin)

  1. #1

    Info High Pass Filter in GIMP (new plugin)

    I am not sure if this should be in the resources section or in the tutorial section, but here it is, anyway.

    GIMP doesn't have a high pass filter. I had previously posted about "faking" a high pass filter with GIMP to get rid of pattern noise in this post.

    Then Redrobes posted a great thread on creating seamless textures that relied heavily on high pass filters.

    More recently, I cam across a few external posts on sharpenning images using high pass filter overlays, rather than unsharp masking (for photoshop).

    Because of all that I decided to write a high pass filter plugin. Just unzip the attached file into your scripts directory. It shows up asFilters->Generic->High Pass Filter.

    You can select a blur radius that sets the size of detail to be passed by the filter, a contrast adjustment, as well as an option to keep the source layer or replace it.

    I actually implemented 5 different high pass modes.

    1. Colour - I think this is the same as photoshop's high pass filter effect.
    2. Preserve DC - like colour, but adds the average image colour back in.
    3. Greyscale - this greyscales the layer before high pass filtering.
    4. Greyscale, Apply Chroma - as above, but blends it in with the source layer colours
    5. Redrobes - (for lack of a better name ) follows the procedure in post #17 of this thread


    Here are samples of the 5 filter modes:
    Click image for larger version. 

Name:	hpfsamples1.png 
Views:	798 
Size:	3.22 MB 
ID:	5455

    And various blur amounts:
    Click image for larger version. 

Name:	hpfsamples2.png 
Views:	260 
Size:	105.7 KB 
ID:	5456

    The default blur (10) with different contrast adjustments:
    Click image for larger version. 

Name:	hpfsamples3.png 
Views:	485 
Size:	97.7 KB 
ID:	5457

    And a sample how a high pass filter can be used to make a nifty overlay for a map:
    Click image for larger version. 

Name:	hpfsamples4.png 
Views:	295 
Size:	167.2 KB 
ID:	5458

    -Rob A>
    Attached Files Attached Files

  2. #2
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,187
    Blog Entries
    8

    Post

    I have a mode named after me... sniff... its all too much, im gonna cry.

    This is great Rob. The only bit I cant quite figure is what is the basic difference between the Preserve DC and 'my' mode since I was trying to make a filter to high pass with preserve DC. It does look similar in the results in any case.

    Interesting bit about the stairs. Although I have never procedurally created the staircase pattern I do use one as a transparency to pop over any other type of terrain - like dungeon stone for example.

    Have you tried to use the FFT expansion with a DC preserve - ill attach the kind of filter you need. You will have to adjust the levels to suit Gimp tho. Note the center pixel is 'no change' color - DC preserve. Oh yes should also note - if you get that pixel out by one in any direction it all goes to pot. So try moving it about a little if it doesn't work. The way you can get a definitive answer of course is to give the FFT something all white and get its spectrum and that should have just the one single pixel lit - well thats the one that must be no change.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Temp1.jpg 
Views:	171 
Size:	52.3 KB 
ID:	5460   Click image for larger version. 

Name:	Temp.png 
Views:	196 
Size:	3.0 KB 
ID:	5461  
    Last edited by Redrobes; 07-24-2008 at 06:30 PM.

  3. #3

    Default

    I thought you'd appreciate the honour, especially when I post this up at the Gimp plugin repository 10 years from now someone will say "why is that mode called redrobes?"

    I think the difference comes from adding in the extra blur-average, to the average-blur.

    The basic algorithm I used for all of them (except the redrobes mode) was:

    -duplicate layer
    -blur the duplicate
    -invert the duplicate
    -set the duplicate to 50% opacity, keeping the mode "normal"
    -merge it down.

    This gives the hpf with a base 10 50% grey.

    EDIT: Thanks for the filter. I'm also working to add all of your FFT maps as pick lists in a front-end to the gimp FFT plugin.

    -Rob A>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •