Skip to content

A sample based bokeh simulator that uses inverse tonemapping and weighted (by luminance) sample averaging to produce a bokeh effect. Works on LDR(Low Dynamic Range) Images!

Notifications You must be signed in to change notification settings

Gholamrezadar/bokeh-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bokeh Plus

A sample based bokeh simulator that uses inverse tonemapping and weighted (by luminance) sample averaging to produce a bokeh effect. Works on LDR(Low Dynamic Range) Images!

inspiration from https://www.youtube.com/watch?v=v9x_50czf-4

Usage

python3 bokeh.py img.png out.png

python3 bokeh_opencv.py images/img1.png images/kernel32.png images/out_cv_normal_128.png

Examples

This Method

example1bokeh

No Weighting

example1noweight

Original

example1

This Method

example2bokeh

OpenCV kernel Convolution

example2kernel

OpenCV wow (img**4)

example2cv example2cv128

Sampling

sampling

Requirements

  • Python 3
  • Numpy
  • cv2
  • matplotlib
  • numba

Gholamreza Dar Jun 2023 when I should be doing other things!

About

A sample based bokeh simulator that uses inverse tonemapping and weighted (by luminance) sample averaging to produce a bokeh effect. Works on LDR(Low Dynamic Range) Images!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages