Code Monkey home page Code Monkey logo

enlighten's Introduction

Enlighten

Automatically brighten dark areas in high dynamic range images

This code shows how to automatically brighten the darker areas of high dynamic range images.

To compile (tested on macOS and Ubuntu) just type

% make

To test it

% make test

This image processing method is related to Homomorphic Image Processing but avoids the use of log space processing.

    Homomorphic Filtering - wikipedia

    Homomorphic Filtering - faadooengineers

This method is used in my photo painting app for iOS called "PhotoViva"

The image blurring is implemented by resizing an image to a small size and then resizing it big again.

This process can be implemented in OpenGL using shaders to automatically correct rendered images in real-time.

Enlighten sees images like your eyes see the world.

Credits: Uses https://github.com/nothings/stb to read, write and resize images.

enlighten's People

Contributors

paulhaeberli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

enlighten's Issues

error compilation on Ubuntu 20.04.6 LTS

error compilation on Ubuntu 20.04.6 LTS using Makefile

make                                                                     
cc enlighten.c -o enlighten
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbi__ldr_to_hdr':
enlighten.c:(.text+0x2cc6): undefined reference to `pow'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbi__hdr_to_ldr':
enlighten.c:(.text+0x2e8c): undefined reference to `pow'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbir__srgb_to_linear':
enlighten.c:(.text+0x20c81): undefined reference to `pow'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbir__linear_to_srgb':
enlighten.c:(.text+0x20ccb): undefined reference to `pow'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbir__get_filter_pixel_width':
enlighten.c:(.text+0x212de): undefined reference to `ceil'
/usr/bin/ld: enlighten.c:(.text+0x21314): undefined reference to `ceil'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbir__get_coefficient_width':
enlighten.c:(.text+0x2139f): undefined reference to `ceil'
/usr/bin/ld: enlighten.c:(.text+0x213d0): undefined reference to `ceil'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbir__calculate_sample_range_upsample':
enlighten.c:(.text+0x21723): undefined reference to `floor'
/usr/bin/ld: enlighten.c:(.text+0x21743): undefined reference to `floor'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbir__calculate_sample_range_downsample':
enlighten.c:(.text+0x21803): undefined reference to `floor'
/usr/bin/ld: enlighten.c:(.text+0x21823): undefined reference to `floor'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbir__calculate_coefficients_upsample':
enlighten.c:(.text+0x2189a): undefined reference to `ceil'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `stbir__calculate_coefficients_downsample':
enlighten.c:(.text+0x21b6a): undefined reference to `ceil'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `canvas_diameter':
enlighten.c:(.text+0x28086): undefined reference to `sqrt'
/usr/bin/ld: /tmp/ccpnvA0K.o: in function `canvas_blur':
enlighten.c:(.text+0x28156): undefined reference to `round'
/usr/bin/ld: enlighten.c:(.text+0x28176): undefined reference to `round'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2: all] Error 1

to properly compile I used

gcc enlighten.c -o enlighten -lm 

now it works :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.