We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 813a92b commit ca7df97Copy full SHA for ca7df97
example/images/uhdr.jpg
1.14 MB
example/uhdr.lua
@@ -0,0 +1,17 @@
1
+local vips = require "vips"
2
+
3
+local image = vips.Image.new_from_file("images/uhdr.jpg", { access = "sequential" })
4
+local gainmap = image:get_gainmap()
5
+print("image:", image)
6
7
+if gainmap then
8
+ print("gainmap:", gainmap)
9
+ --[[ Due to reference sharing in the operation cache copying the image
10
+ as below is needed when it is not necessarily unique
11
+ image = image:copy()
12
+ ]]
13
+ -- set the "gainmap" metadata for the original image
14
+ image:set_type(vips.gvalue.image_type, "gainmap", gainmap)
15
+else
16
+ print("No gainmap found. You need libvips >= 8.18 with uhdr support")
17
+end
0 commit comments