Bug 396447 - Median filter
Summary: Median filter
Status: RESOLVED NOT A BUG
Alias: None
Product: krita
Classification: Applications
Component: Filters (show other bugs)
Version: unspecified
Platform: Other All
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-12 17:29 UTC by Alex
Modified: 2019-04-09 07:00 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A useful example of using a median option: to remove tourists from a photograph :-) . But maybe one Median option is not related to the other one. (80.83 KB, image/jpeg)
2019-02-10 20:16 UTC, Ganton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2018-07-12 17:29:37 UTC
This would be great addition to current blurring filter set, allowing quick de-noising in conjunction with masks.

gegl code is available:
https://github.com/GNOME/gegl/blob/758b21f68438c53496078fb5cf177166f32e603a/operations/common/median-blur.c
Comment 1 Halla Rempt 2018-08-24 18:37:05 UTC
Please, tell us what it is, why it is needed, what it is good for -- just showing us some code to copy isn't really enough to make anyone spend time on it.
Comment 2 Alex 2018-09-07 06:34:57 UTC
Main use case is to smooth skin and remove unwanted noise that contain "standing out" pixels like dust, scratches, hot pixels etc. Few examples:
http://photoshopper27.blogspot.com/2009/07/median-filter-smoothen-skin-in.html
http://fstopspot.com/main/wp-content/gallery/cache/2360__575x_before-after-median-filter.jpg
http://artemhlezin.com/2016/09/04/median.html
https://github.com/abderhasan/median-filter

In artistic way it can be used as one step to "get rid" of hot pixels to sample colors (like from smoothed out skin on first link) or as one step to give "watercolor like" appearance:
https://www.photoshopessentials.com/photo-effects/watercolor-painting/
(here more effects are used, median is only one of them)

BTW I've found hybrid median filter, maybe this can be useful too:
https://www.mathworks.com/matlabcentral/fileexchange/25825-hybrid-median-filtering
Comment 3 Ganton 2019-02-10 20:16:24 UTC
Created attachment 117970 [details]
A useful example of using a median option: to remove tourists from a photograph :-) . But maybe one Median option is not related to the other one.

> > Median filter

> Please, tell us what it is, why it is needed, what it is good for

I attach a useful example of using a Photoshop "median" option: to remove tourists from a photograph :-) . But maybe one "median" option is not related to the other one.
Comment 4 Scott Petrovic 2019-04-08 20:24:52 UTC
We have most of our filters in the G'MIC filters engine. 

There is already a Smooth [Median] filter and a Blend[Median] option. We generally rely on the G'MIC library for adding all filter functionality. 

My proposal is if there are additional filters needed, proposing it to the G'MIC team would be best. That way the results would not just benefit Krita, but also other applications like GIMP.

Does the already included filters do what you need?
Comment 5 vanyossi 2019-04-09 07:00:01 UTC
Im familiar with the median filter, its moslty used to remove noise and subpixel imperfections from a still scene. Several pictures have to be taken and then blended toguether using median average to get the "real" color, also can be used to fake long exposures or get more detailed photos. its an interesting technique eand can be done with blending modes and layers in certain disposition.

Krita with GMIc is already capable of such effect. With all images loaded as layers open GMIC > layers > blend[median]. Set input layers to all.

I'll mark this bug as resolved, but if you feel the filter does not do the same you can reopen it.