{"id":19383359,"url":"https://github.com/mdouchement/hdr","last_synced_at":"2025-09-11T13:41:12.717Z","repository":{"id":79844212,"uuid":"88550917","full_name":"mdouchement/hdr","owner":"mdouchement","description":"HDR is a library that handles RAW image format written with Golang","archived":false,"fork":false,"pushed_at":"2023-02-04T12:19:10.000Z","size":221,"stargazers_count":38,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T21:38:04.698Z","etag":null,"topics":["drago","golang","golang-library","hdr","hdr-image","hdri","icam","raw","reinhard","tmo","tone-mapping"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdouchement.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-17T21:08:57.000Z","updated_at":"2024-10-19T12:36:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"18523d53-e9b4-44ea-9a6d-bc09dacff131","html_url":"https://github.com/mdouchement/hdr","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mdouchement/hdr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Fhdr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Fhdr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Fhdr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Fhdr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdouchement","download_url":"https://codeload.github.com/mdouchement/hdr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Fhdr/sbom","scorecard":{"id":633344,"data":{"date":"2025-08-11","repo":{"name":"github.com/mdouchement/hdr","commit":"63bdc666c03a0adf441afb5617dd5b4eeb06ef4d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T08:27:54.261Z","repository_id":79844212,"created_at":"2025-08-21T08:27:54.261Z","updated_at":"2025-08-21T08:27:54.261Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274647773,"owners_count":25324293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drago","golang","golang-library","hdr","hdr-image","hdri","icam","raw","reinhard","tmo","tone-mapping"],"created_at":"2024-11-10T09:25:45.543Z","updated_at":"2025-09-11T13:41:12.687Z","avatar_url":"https://github.com/mdouchement.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HDR - High Dynamic Range\n\n[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/mdouchement/hdr)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mdouchement/hdr)](https://goreportcard.com/report/github.com/mdouchement/hdr)\n[![License](https://img.shields.io/github/license/mdouchement/hdr.svg)](http://opensource.org/licenses/MIT)\n\nHDR is a library that handles RAW image format written with Golang. [Here](https://github.com/mdouchement/hdr_examples#hdr-gallery-examples) some rendering examples.\n\nIt aims to provide tools to read [HDR](https://en.wikipedia.org/wiki/High-dynamic-range_imaging) files and convert it to a LDR (Low Dynamic Range, aka PNG/JPEG/etc.) in an `image.Image` object.\n\n\nDocumentations:\n - http://www.anyhere.com/gward/hdrenc/hdr_encodings.html\n\n\n## Supported codecs (file formats)\n\n- Radiance RGBE/XYZE\n- PFM, Portable FloatMap file format\n- TIFF using [mdouchement/tiff](https://github.com/mdouchement/tiff)\n- CRAD, homemade HDR file format\n\n## Supported tone mapping operators\n\nRead this [documentation](http://osp.wikidot.com/parameters-for-photographers) to find what TMO use.\n\nRead this [documentation](https://hal.archives-ouvertes.fr/hal-00724931/document) to understand what is a TMO.\n\n- Linear\n- Logarithmic\n- Drago '03    - Adaptive logarithmic mapping for displaying high contrast scenes\n- Durand       - Fast bilateral filtering for the display of high-dynamic-range images\n- Reinhard '05 - Photographic tone reproduction for digital images\n  - Playing with parameters could provide better rendering\n- Custom Reinhard '05\n\t- Rendering looks like a JPEG photo taken with a smartphone\n- iCAM06       - A refined image appearance model for HDR image rendering\n\n## Usage\n\n```sh\ngo get github.com/mdouchement/hdr\n```\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/png\"\n\t\"os\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"github.com/mdouchement/hdr\"\n\t_ \"github.com/mdouchement/hdr/codec/rgbe\"\n\t\"github.com/mdouchement/hdr/tmo\"\n)\n\n// Samples:\n//\n// http://www.anyhere.com/gward/hdrenc/pages/originals.html\n// http://resources.mpi-inf.mpg.de/tmo/logmap/ (High Contrast Scenes)\n\nvar (\n\t// input = \"/Users/mdouchement/tmp/hdr/memorial_o876.hdr\"\n\t// input = \"/Users/mdouchement/tmp/hdr/MtTamWest_o281.hdr\"\n\t// input = \"/Users/mdouchement/tmp/hdr/rend02_oC95.hdr\"\n\t// input = \"/Users/mdouchement/tmp/hdr/Tree_oAC1.hdr\"\n\tinput  = \"/Users/mdouchement/tmp/hdr/Apartment_float_o15C.hdr\"\n\toutput = \"/Users/mdouchement/tmp/hdr/output.png\"\n)\n\nfunc main() {\n\tfmt.Printf(\"Using %d CPUs\\n\", runtime.NumCPU())\n\n\tfi, err := os.Open(input)\n\tcheck(err)\n\tdefer fi.Close()\n\n\tstart := time.Now()\n\n\tm, fname, err := image.Decode(fi)\n\tcheck(err)\n\n\tfmt.Printf(\"Read image (%s) took %v\\n\", fname, time.Since(start))\n\n\tif hdrm, ok := m.(hdr.Image); ok {\n\t\tstartTMO := time.Now()\n\n\t\t// t := tmo.NewLinear(hdrm)\n\t\t// t := tmo.NewLogarithmic(hdrm)\n\t\t// t := tmo.NewDefaultDrago03(hdrm)\n\t\t// t := tmo.NewDefaultDurand(hdrm)\n\t\t// t := tmo.NewDefaultCustomReinhard05(hdrm)\n\t\tt := tmo.NewDefaultReinhard05(hdrm)\n\t\t// t := tmo.NewDefaultICam06(hdrm)\n\t\tm = t.Perform()\n\n\t\tfmt.Println(\"Apply TMO took\", time.Since(startTMO))\n\t}\n\n\tfo, err := os.Create(output)\n\tcheck(err)\n\n\tpng.Encode(fo, m)\n\n\tfmt.Println(\"Total\", time.Since(start))\n}\n\nfunc check(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n\n## HDR Tools\n\n[https://github.com/mdouchement/hdrtool](https://github.com/mdouchement/hdrtool)\n\n## License\n\n**MIT**\n\n\n## Implementing a TMO\n\nA TMO must implement `tmo.ToneMappingOperator`:\n\n```go\ntype ToneMappingOperator interface {\n\t// Perform runs the TMO mapping.\n\tPerform() image.Image\n}\n```\n\n## Implementing an image codec\n\n- Reader\n\n```go\n// DecodeConfig returns the color model and dimensions of a PFM image without\n// decoding the entire image.\nfunc DecodeConfig(r io.Reader) (image.Config, error) {\n  // ...\n  return m, err\n}\n\n// Decode reads a HDR image from r and returns an image.Image.\nfunc Decode(r io.Reader) (img image.Image, err error) {\n  // ...\n  return\n}\n\nfunc init() {\n  // Register the format in the official lib.\n  // https://golang.org/pkg/image/#RegisterFormat\n  image.RegisterFormat(\"format-name\", \"magic-code\", Decode, DecodeConfig)\n}\n```\n\n- Writer\n\n```go\n// Encode writes the Image m to w in PFM format.\nfunc Encode(w io.Writer, m hdr.Image) error {\n  return nil\n}\n```\n\n## Contributing\n\nAll PRs are welcome. If you implement a TMO or an image codec in a dedicated repository, please tell me in order to link it in this readme.\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n5. Push to the branch (git push origin my-new-feature)\n6. Create new Pull Request\n\nAs possible, run the following commands to format and lint the code:\n\n```sh\n# Format\nfind . -name '*.go' -not -path './vendor*' -exec gofmt -s -w {} \\;\n\n# Lint\ngolangci-lint run -c .golangci.yml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdouchement%2Fhdr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdouchement%2Fhdr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdouchement%2Fhdr/lists"}