• Stars
    star
    335
  • Rank 121,524 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Seamless copy-and-paste of images with Poisson Blending.

poisson_blend - A simple, readable implementation of Poisson Blending

An implementation of Poisson Blending, that demonstrates the concepts explained in my article.

To use the progam, you specify a source image and a target image. The source image is seamlessly copied and pasted into the target image, at some specified pixel location.

By running the command line

poisson_blend -source img/kitten.png -target img/library.png -mask img/kittenmask.png -output result.png -mx 280 -my 340

An image of a kitten can be seamlessly copied and pasted into the library, at the position (280, 340), as can be seen below. The mask specifies which pixels of the kitten should actually be copied and pasted. The remaining pixels are ignored. Note that only pure red pixels of RGB color (255,0,0) are considered part of the mask.

The result of the above command line can be seen below:

kitten library kitten mask kitten mask
source target mask result

Gallery

A small gallery of images made with this program are presented below.

penguin library penguin library
source target result
moon gothenburg moon gothenburg
source target result
penguin beach penguin beach
source target result
eagle liberty eagle liberty
source target result
water eagle lake water eagle lake
source target result
balloon colosseum balloon colosseum
source target result

Building

The only dependencies are lodepng and Eigen. Both of which are included within this repository.

We use CMake for building. If on Linux or OS X, you can build it in the terminal by doing something like:

mkdir build && cd build && cmake .. && make

If on Windows, create a build/ folder, and run cmake .. from inside that folder. This will create a visual studio solution(if you have visual studio). Launch that solution, and then simply compile the project named poisson_blend.

Image Sources

Below we list the soures of all images that we used in the gallery.

More Repositories

1

vulkan_minimal_compute

Minimal Example of Using Vulkan for Compute Operations. Only ~400LOC.
C++
697
star
2

regl-cnn

Digit recognition with Convolutional Neural Networks in WebGL
JavaScript
502
star
3

Awesome-CUDA

This is a list of useful libraries and resources for CUDA development.
421
star
4

wireframe-world

An infinite wireframe world in WebGL
JavaScript
357
star
5

gl-water2d

2D liquid simulation in WebGL
JavaScript
286
star
6

hole_fixer

Demo implementation of smoothly filling holes in 3D meshes using surface fairing
C++
250
star
7

glsl-godrays

This module implements a volumetric light scattering effect(godrays)
JavaScript
190
star
8

cute-deferred-shading

Cute little deferred shading implementation.
C++
137
star
9

gl-catmull-clark

A javascript implementation of the Catmull-Clark subdivision surface algorithm
JavaScript
104
star
10

fluid_sim

Flashy 2D fluid simulations experiments.
C
102
star
11

gl-rock

Procedural Generation of Rocks in WebGL
JavaScript
97
star
12

glsl-worley

Worley noise implementation for WebGL shaders
GLSL
85
star
13

pnp-gui

Minimalistic Immediate Mode GUI toolkit for WebGL
JavaScript
83
star
14

sse-avx-rasterization

Triangle rasterization routines accelerated by SSE and AVX
C++
62
star
15

cloud_gen

Procedural Generation of Clouds with Vector Graphics
C++
49
star
16

webgl-rsm

Real-time Indirect lighting with Reflective Shadows Maps in WebGL
JavaScript
45
star
17

planar_proj_shadows

Demo of Planar Projected Shadows in regl
JavaScript
32
star
18

glsl-cos-palette

glsl function for making cosine palettes
JavaScript
31
star
19

teapot_shooter

Augmented Reality Teapot Shooter made using Unity and ARCore
C#
30
star
20

image-load-store-demo

A small demo and tutorial of the image load/store feature of OpenGL 4
C++
26
star
21

glsl-gradient-palette

Module for creating gradient palettes for usage in glsl.
JavaScript
19
star
22

regl-anim

Some weird animations made with regl and WebGL
JavaScript
17
star
23

regl-fire

Fire particle system made with regl
JavaScript
17
star
24

tess-opt

Demonstration of how we can use tessellation shaders to make faster fragment shaders.
C++
15
star
25

erkaman.github.io

The source code of my website.
HTML
13
star
26

regl-webvr-demo

Demo that shows how to use regl and WebVR together
JavaScript
11
star
27

ffmpeg-add-text-to-video-tutorial

Tutorial that shows how to add text to a video file with ffmpeg
9
star
28

parle-cuda

A reference implementation of RLE in CUDA
Cuda
9
star
29

NeoTextureEdit2

Fork of NeoTextureEdit that fixes several things.
Java
8
star
30

regl-stats-widget

Small widget for displaying statistics of regl
JavaScript
8
star
31

gl-quads-to-tris

WebGL helper module that converts an array of quad indices to an array of triangles indices
JavaScript
7
star
32

spiky-anim

The source code of some silly spiky animation I made
C++
7
star
33

smiley

:^) :^) :^) :^) :^) :^), :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^).
JavaScript
6
star
34

particle-simd

SIMD-accelerated particle simulation in C++
C++
5
star
35

digital-image-formats

An exploration of the inner workings of digital image formats.
C++
3
star
36

gl-camera-pos-from-view-matrix

A helper module that allows you to recover the camera position from a view matrix
JavaScript
3
star
37

regl-cpp

Remaking regl in C++
C
3
star
38

font_creator_cpp

A simple program that creates a font atlas using FreeType
C++
2
star
39

scan_shift_jis.rb

Small utility for scanning Shift-JIS encoded strings in a file.
Ruby
1
star
40

smw-tools

Java
1
star
41

font_sheet.py

Python
1
star
42

cloth

C++
1
star
43

BrainfuckSharp

A Brainfuck compiler for the .NET framework.
C#
1
star
44

sculpture

C++
1
star
45

texture-editor

C++
1
star
46

dotfiles

My miscellaneous configuration files.
Emacs Lisp
1
star
47

aabb_create

Small utility for computing an AABB from a wavefront object file.
C++
1
star