zavolokas / Inpainting

Want to remove something(someone) from a photo as it never was there? This is .NET implementation of content-aware fill. It smartly fills in unwanted or missing areas of photographs.
MIT License
367 stars 47 forks source link
computer-vision content-aware-fill hacktoberfest image-completion image-processing inpaint inpainting photo-editing

Inpainting

[license]() Build Status Drone Status Donate Tweet

.NET implementation of content-aware fill (also known as inpainting or image completion) in image processing domain.

What is it for?

Content aware fill is used to fill in unwanted or missing areas of photographs. See an example of such fill below where we don't want to have the man in blue t-shirt on our picture:

Original image Processed image
t009 r009

Try in Docker

docker run -p 5000:80 -it --rm zavolokas/inpainter:latest

Navigate to http://localhost:5000

How to use it?

var inpainter = new Inpainter();
var result = inpainter.Inpaint(imageArgb, markupArgb, donors);
result
    .FromArgbToBitmap()
    .SaveTo(resultPath, ImageFormat.Png)
    .ShowFile();

The Inpainter takes as input

Note: the images are not GDI+ images but images in an internal format and can be obtained from GDI+ Bitmaps using extensions.

Examples

Original Markup Process
t009 m009 p009
t020 m020 p020
t023 m023 p023
t058 m058 p058
t067 m067 p067

Settings

The execution of the algorithm can be customized by adjusting the settings.

Donors

Credits

The implementation is based on following publications: