Giter Site home page Giter Site logo

linville / gray16lib Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 2.0 3.82 MB

πŸ“ˆ 16-bit grayscale processing algorithms for use with QImage::Format_Grayscale16.

License: ISC License

C++ 93.44% C 0.63% CMake 5.93%
qt cpp grayscale 16-bit image-processing

gray16lib's Introduction

Gray16Lib + Gray16Demo

Gray16Lib is a library to provide various grayscale image processing algorithms to down-convert 16-bit grayscale images to bit-depths that are viewable on standard displays and maintain image contrast.

16-bit grayscale imagery is commonly encountered in scientific fields. Two notable examples include X-Ray and Aerial imaging. Sensors may raster data such as light intensity, or elevation data, using a 16-bit value. Typical consumer displays are capable of displaying 24-bit color (8-bits per channel: Red/Green/Blue, with some supporting pseudo 10-bit, usually 8-bit + FRC (Frame Rate Control) - basically faking the extra depth by flashing a pixel between two colors). To view the 16-bits of data on a display capable of displaying on 8-bits, it becomes necessary to appropriately "throw away" pieces of data while still maintaining important image contrast or splitting the 16-bits across multiple channels of 8-bit data.

Gray16Demo is an example application that will load a 16-bit Grayscale PNG and allow the user to interactively explore different image processing algorithms. Open your own 16-bit PNGs or load an example from the Examples menu (see the included 16-bit examples here).

Gray16Demo Screenshot

Requirements

Image Processing Algorithms

  1. Manual
    • Manually select Black-Point and White-Point values.
  2. Offset / Gain
    • Offset pixel values then bit-shift them. No floating point operations.
    • Auto-Offset, Manual Gain
      • Offset chosen by least-exposed pixel, that isn't zero-exposed.
      • Offset (+ 255) chosen by most-exposed pixel, that isn't fully saturated.
  3. False-Color (conversion to RGB32)
    • Converts a 16-bit grayscale to an RGB gradient. Supports various gradients.
    1. Black Body

Compiling Gray16Lib

git clone https://github.com/linville/gray16lib.git
cd gray16lib
mkdir build && cd build
cmake ..
make

Todo

  • Add more algorithms.
  • Add more examples.

Additional Reading

gray16lib's People

Contributors

linville avatar

Stargazers

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

Watchers

 avatar

gray16lib's Issues

build issue: std::reduce

I am trying to build the code on ubuntu using Qt5.13.0 in combination with gcc-9 and g++-9.
All compiles well except line 119 in image_histogram_widget.cpp

I get the error: no matching function for call to β€˜reduce(QVector::const_iterator, QVector::const_iterator)'

Code on line 119 | int sum = std::reduce(histogram.constBegin(), histogram.constEnd());

issue

std::reduce takes a minimum of 3 arguments, you are just providing 2

Can you please help resolving this issue.

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.