hdrpil: auxiliary module to apply HDR to images

PyHdust hdrpil module: third-part functions for HDR process of images

import pyhdust.hdrpil asd hdr proj = hdr.hdr(case=’img04’, img_type=’png’, cur_dir=’./’) proj.get_hdr(strength=[1.],naturalness=[1.0,1.1,1.2,1.5])

license:

?

class pyhdust.hdrpil.hdr(case='', resize=None, img_type='.jpg', cur_dir='./')[source]

a collection of images to merege into HDR

blend an arbitrary number of photos into a single HDR image or several images with various combinations of HDR parameters

it is assumed that project folders contain all the images you want to merge case = folder name cur_dir = folder where the project folders are located images are auto-sorted by degree of exposure (image brightness)

bal(im)[source]

adjust the balance of the mask (re-distribute the histogram so that there are more extreme blacks and whites) like increasing the contrast, but without clipping and maintains overall average image brightness

final_blend(im1, im2)[source]

combines a saturated image with a contrast image and puts them in a dictionary of completed images

get_hdr(strength=[0.0, 1.0, 2.0], naturalness=[0.8, 0.9, 1.0])[source]

process the hdr image(s) strength - a list or a float that defines how strong the hdr

effect should be

  • a value of zero will combine images by using a greyscale image average

  • a value greater than zero will use higher contrast versions of those greyscale images

naturalness- values between zero and one
  • zero will be a very high-contrast image

  • 1.0 will be a very flat image

  • 0.7 to 0.9 tend to give the best results

get_imgs()[source]

load a list of images from folder sort them from lightest to darkest

get_masks(imgs)[source]

create a set of masks from a list of images (one mask for every adjacent pair of images

merge(imgs)[source]

combine a set images into a smaller set by combinding all adjacent images

merge_all(imgs)[source]

iteratively merge a set of images until only one remains

print_set(im_dict)[source]

print all rendered images

save_im(im, name)[source]

save an image