Opened 18 months ago

Closed 18 months ago

Last modified 17 months ago

#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 Michael Koch, 18 months ago

P.S. If black is set bigger than 0.5, then the amplification seems to become negative. Black and white are swapped.

comment:2 by Elon Musk, 18 months ago

Resolution: invalid
Status: newclosed

It is using base-e exponential function, not what you want/imagined.

comment:3 by Michael Koch, 18 months ago

Why does the polarity change at black=0.5? Does that make any sense at all?

comment:4 by Michael Koch, 18 months ago

The subtraction of s->black in line 71 doesn't look correct.

comment:5 by Elon Musk, 18 months ago

It is 1000000% correct. Check your factchecker.

comment:6 by Elon Musk, 17 months ago

The invert of pixels bug have been fixed.

in reply to:  6 comment:7 by Michael Koch, 17 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.

Note: See TracTickets for help on using tickets.