#10041 closed defect (invalid)
Problem with exposure filter
Reported by: | Michael Koch | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avfilter |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Make a 10-bit grayscale test image:
ffmpeg -f lavfi -i color=black:s=16x64,format=gray10le -lavfi geq=lum='X+16*Y',format=gray10le,datascope=s=640x768:mode=color2:format=hex -frames 1 -y test.png
Apply the exposure filter, followed by a limiter:
ffmpeg -i test.png -vf format=rgb48,exposure=exposure=1:black=0.4,limiter -y out.png
exposure=1 should be equivalent to a factor 2, but the amplification in the output image is much stronger. It becomes even worse if black=0.5 is used, then the output image contains only black or white pixels, that's infinite amplification.
Either something is wrong, or I did misunderstand what the filter is supposed to do.
Change History (7)
comment:1 by , 22 months ago
comment:2 by , 22 months ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
It is using base-e exponential function, not what you want/imagined.
comment:3 by , 22 months ago
Why does the polarity change at black=0.5? Does that make any sense at all?
comment:7 by , 22 months ago
Replying to Elon Musk:
The invert of pixels bug have been fixed.
The subtraction of s->black (now in line 70) doesn't make any sense in my opinion.
And it would be better if the unit of "exposure" is photographic EV values, I mean exposure=1 should be a factor of 2 and exposure=-1 should be a factor of 0.5.
I suggest to replace lines 70-73 by
s->scale = exp(s->exposure * log(2.0))
It's always positive.
P.S. If black is set bigger than 0.5, then the amplification seems to become negative. Black and white are swapped.