mdouchement / hdr Goto Github PK
View Code? Open in Web Editor NEWHDR is a library that handles RAW image format written with Golang
License: MIT License
HDR is a library that handles RAW image format written with Golang
License: MIT License
// Chromatic adaptation (White adaptation) - Section 2.3
- t.white = filter.FastGaussian(t.normalized, (t.minDim() / 2))
+ // t.white = filter.FastGaussian(t.normalized, (t.minDim() / 2))
+ wh := filter.NewYFastBilateralAuto(t.normalized)
+ wh.SigmaSpace = float64(t.minDim() / 2)
+ wh.Perform()
+ t.white = wh.HDRResultImage()
Replace gometalinter by golangci-lint
Replace util
package with more dedicated packages.
Move also generic functions defined in filter
and tmo
to these new packages (e.g. filter/filter.go#clamp(...)
).
Hello and thanks for your work,
I wanted to encode several HDR images into one buffer or file but then rgbe.Decode
seems to read more bytes than it should and I can't figure why after reviewing your code.
Encoding and decoding once works fine though.
This, for instance, will throw an error:
rgbe.Encode(buf, img)
rgbe.Encode(buf, img)
img, e := rgbe.Decode(buf)
img, e = rgbe.Decode(buf)
More verbose:
// Encode twice the HDR image and check how many bytes were written
rgbe.Encode(buf, img)
rgbe.Encode(buf, img)
writtenBytes := buf.Len()
// No problem, the first img is fine
img, e := rgbe.Decode(buf)
// More bytes read than written though
fmt.Printf("Bytes read: %v; Bytes written: %v", writtenBytes - buf.Len(), writtenBytes)
// And this returns an invalid format error because we begin to read too far in the buffer
img, e = rgbe.Decode(buf)
if e != nil {
log.Fatal(e)
}
Any idea why?
This issue will introduce an important code modification (imports)
https://github.com/golang-standards/project-layout
PS: Looks like these standards are best practices for applications' repositories not libraries' repositories
In the normalize step, the percentile slice could be replaced by a smart function .
The percentile slice uses a large amount of memory for only 2 values are needed (minRGB && maxRGB).
Hi, mdouchement !
Couldn't find a better way to contact you via github, apologies for raising this as an issue.
Many thanks for the hdr library ! It's been very useful for a hobby project of mine, exposure stacking eclipse photos.
Before I found your library, I implemented the fattal02 TMO in Golang. It depends on the fftw3 C library. (To be more honest, I just ported the C implementation from the pfstmo project :) Code here: https://github.com/abworrall/eclipse-hdr/blob/master/pkg/fattal02/fattal02.go
After finding your hdr library, I revised it to implement your API, and also inherit the TMOs you'd already implemented - so thanks again :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.