Closed Redo11 closed 1 month ago
Possible problems with higher depths as well. Gmic_qt has no problem with higher than 8 bit depths.
When reading a 16bits/channel image in G'MIC, the value range you get for your image is [0,65535]. Most of the command/filters in G'MIC are implemented for a value range in [0,255], so it's not so surprising that the outcome of these commands is not what is expected. When reading a 16bits/channel image, I suggest you first divide your image values by 257 before applying the processing command, like:
$ gmic input16.png div 257 fx_custom_transform "i","i","i","i","i","i",0 mul 257 output output16.png
You won't lose any precision as images in G'MIC are stored in float-valued format.
When reading a 16bits/channel image in G'MIC, the value range you get for your image is [0,65535]. Most of the command/filters in G'MIC are implemented for a value range in [0,255], so it's not so surprising that the outcome of these commands is not what is expected. When reading a 16bits/channel image, I suggest you first divide your image values by 257 before applying the processing command, like:
$ gmic input16.png div 257 fx_custom_transform "i","i","i","i","i","i",0 mul 257 output output16.png
You won't lose any precision as images in G'MIC are stored in float-valued format.
I have a mix of 32 bit, 16 bit and 8 bit images. I want to apply a watermark and cause degradation to these images, to upload online. How am I supposed to do that consistently?
I have a mix of 32 bit, 16 bit and 8 bit images. I want to apply a watermark and cause degradation to these images, to upload online. How am I supposed to do that consistently?
A simple solution is to first store the min/max values of your images into a variable, normalize your image to [0,255], apply the filter, then renormalize back to the originel values:
$ gmic inputXX.png m,M:=im,iM normalize 0,255 fx_custom_transform "i","i","i","i","i","i",0 normalize \$m,\$M output outputXX.png
thanks a lot
When I put a filter on a 16 bit image, the output gets overblown and generally just white.
16 bit image input:![input_16bit](https://github.com/GreycLab/gmic/assets/49594490/cccd633d-ecda-4392-bcd0-1f5761671a69)
applied
Output:![input_16bit png out](https://github.com/GreycLab/gmic/assets/49594490/bac2ca31-76f7-40c7-bce5-c33402fff302)
8 bit image input:![input](https://github.com/GreycLab/gmic/assets/49594490/5754bdaa-2b67-4788-a576-7deefea033f9)
applied
Output:![input png out](https://github.com/GreycLab/gmic/assets/49594490/27d44cb6-fa85-49c6-b2f5-1fa4bc7eef4a)