Code Monkey home page Code Monkey logo

hdr_viewer_pyplot's Introduction

HDR_Viewer_PyPlot

A simple high dynamic range (HDR) image viewer using matplotlib.pyplot for displaying and imageio for reading/writing. It's all in python, easy to extend.

alt text

Features

  • Displays HDR images (e.g., .exr and .hdr images). I use imageio for reading images, so anything imageio supports can be displayed.
  • Toggle gamma correction (g)
  • Adjust exposure (scroll). Hold shift to change the exposure faster.
  • See pixel values under the mouse cursor
  • See general statistics (original resolution, min/max pixel value, spherical mean, spherical standard deviation, contrast)
  • Toggle between a diffusely convolved image and the original image (d). Make sure you do this for HDRI's intended for image-based lighting. Note that the first time you press d, it will take a few seconds to compute the diffuse image.
  • Save your edited image (o), saves to ./output/ or ./dist/HDR_Viewer_PyPlot/output/

Running via python

You'll need to pip install modules including imageio (with EXR support) , matplotlib, numpy, and cv2.

The run: python [string filepath] optional: [int resizeWidth]

For example:

python HDR_Viewer_PyPlot.py ./images/grace-new.exr 512

resizeWidth is useful if you have very large images that will be too slow to display.

Packaging into an Executable

It can be useful to compile into an executable, so then you can have your .exr or .hdr images always open with this program.

pip install pyinstaller

pyinstaller HDR_Viewer_PyPlot.spec --noconfirm

This will package into dist/HDR_Viewer_PyPlot. Point your HDR images (i.e., right click the file, "Open with" > "Choose another app", and select dist/HDR_Viewer_PyPlot/HDR_Viewer_PyPlot.exe

When rebuilding, you might need to manually delete dist in case of permission denied issues (e.g., rmdir /s dist and maybe rmdir /s build).

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.