Bug 374972 - High Pass Filter
Summary: High Pass Filter
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Filters (show other bugs)
Version: 3.1.1
Platform: Other Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: reptillia39
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-12 19:48 UTC by Deo
Modified: 2021-02-21 17:12 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
tutorial (1.49 MB, image/png)
2017-01-12 19:48 UTC, Deo
Details
[picture of steps to understand the description of the RedRobes highpass method] (1.16 MB, image/png)
2017-01-14 21:43 UTC, David REVOY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Deo 2017-01-12 19:48:32 UTC
Created attachment 103378 [details]
tutorial

It's really incredible all the work you do guys, thanks.

I would like to Krita to have "High Pass Flter" like Gimp filter extra tool, like this one:

http://registry.gimp.org/node/7385

is super usefully to remove the light from images and avarage the hole color of the texture.
Comment 1 David REVOY 2017-01-13 13:51:38 UTC
Hi @Deo, Krita has this one:
Go to (top menu)>Filter>GMIC
In categorie 'Detail' you'll find a "High Pass Filter".
Comment 2 Deo 2017-01-13 16:44:33 UTC
Sure have it, but doesn't really work as high pass, that plugin even is close to the GIMP truly automated high pass filter, has like 5 algorithms super power full, I did even a short tutorial showing you the options of the tutorial, I did with Krista with the filters but the result was a really bad work... Did you see the plugin of GIMP?
Comment 3 Deo 2017-01-13 16:45:26 UTC
Even Photoshop High pass works much better :(
Comment 4 Halla Rempt 2017-01-14 09:02:36 UTC
Setting to Wish, since it's a feature request.
Comment 5 David REVOY 2017-01-14 21:43:44 UTC
Created attachment 103415 [details]
[picture of steps to understand the description of the RedRobes highpass method]

Yes,  I agree. it's a feature request. I was curious about the Gimp plugin and @Deo usage about the option 'Redrobes'; an option *I didn't know* about high-pass. The result is good: better than other 'high-pass' filter I used before (even GMIC one). Here is the core informations I found about it [1] :

The GIMP plugin filter propose 5 Highpass methods:
   1. Colour - a classic high-pass similar to Ps.
   2. Preserve DC - like colour, but adds the average image colour back in.
   3. Greyscale - turn to greyscales the layer before high pass filtering.
   4. Greyscale, Apply Chroma - as above, but blends it in with the source layer colours
   5. Redrobes ( read down this post )

The basic steps used for all filters ( except "Redrobes" one) :
  -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.)

The Redrobes one is a bit more complex: ( see image in attachment, for reference )
  -Get an image 1.
  -Blur it quite a lot 2.
  -Blur it until its a constant colour 3.
  -Use Image arithmetic to generate 2 - 3 => 4
  -Use Image arithmetic to generate 3 - 2 => 5
  -Take 1 and subtract 4 and add 5 => 6

[1] this information, attachement were created and quoted from RobA and RedRobes (creator of the plugin) on the forum cartographerguild.com, main thread: link: https://www.cartographersguild.com/showthread.php?t=2582 to be used here later as references.
Comment 6 Halla Rempt 2017-01-15 13:17:51 UTC
I was looking at the scm file, too, yesterday, wondering how easy it would be to translate to python as a test-case for the new scripting plugin. I'm currently stuck figuring out how to do the histogram bit, but it looks quite possible.
Comment 7 TekuConcept 2018-04-20 21:53:14 UTC
@Boudewijn Rempt As I'm sure you are aware, the histogram bit is just getting the average color of the source layer.

I prototyped the script in C# to test a few things, and what I did for the histogram mean for redrobes (or spatial averaging as it might also be known) was sum up the RGB values then divided by the number if pixels.

So p_avg = 1/pixelCount * sum k=0->N (p_k).

I would love to help you with this if you'd like. :)
Comment 8 Scott Petrovic 2019-01-14 21:23:15 UTC
I wonder if this would be a better task for G'MIC than Krita. Those developers specialize in making filters, so they might be able to come up with something even better. Once they update it, Krita could update to include the improved filters.
Comment 9 reptillia39 2019-04-12 01:05:22 UTC
I'm working on this filter. Right now, I managed to get something like it for high depth images. I will look into recreating GIMP options. I would like step by step for all GIMP options.
Comment 10 reptillia39 2019-04-12 14:14:50 UTC
Another update, I found source to GIMP high pass, and I may be able to put them in Krita. But, I'll have to figure out how to get two while next pixel loop to work.
Comment 11 reptillia39 2019-04-13 02:43:53 UTC
Update - Now, all that is needed is to get mixColors operation to work on the code, and the basic version of high pass is finished. Decided to skip grayscale version as using desaturate filter mask and high pass should fix that issue nicely, and it would be tremendously difficult to mix the current high pass with desaturate. I'm not sure about DC preservation, but I hear that direct math isn't possible, so I don't know if you could use overlay mode. Mix colors could make it possible to generate average colors. I might even create average colors filter which averages all the colors except for alpha colors.

Also, for reference - https://github.com/andymeneely/Gimp-Scripts/blob/master/examples/high-pass.scm
Comment 12 reptillia39 2019-04-13 02:51:11 UTC
Forgot to mention, there is no plan to finish this for 4.2 as we're on Feature Freeze. So, for the subscribers not up to date on Krita development. There's this new.
Comment 13 reptillia39 2019-04-24 04:40:01 UTC
The basic version of the filter has been completed. Next up is chroma, and then preserve dc, and finally redrobes. Chroma is easy though.
Comment 14 Halla Rempt 2021-02-21 17:12:39 UTC
Implemented in libs/plugins/gaussianhighpass.