All problems
Sepia Filter
Problem
Apply the classic sepia transform to an RGB image.
tr = 0.393r + 0.769g + 0.189b, tg = 0.349r + 0.686g + 0.168b and tb = 0.272r + 0.534g + 0.131b. Each channel is rounded to the nearest integer and clamped to [0, 255].
Test cases
case 1
in: [[[[255,0,0]]]]
expected: [[[100,89,69]]]
case 2
in: [[[[0,255,0]]]]
expected: [[[196,175,136]]]
case 3
in: [[[[0,0,255]]]]
expected: [[[48,43,33]]]
case 4
in: [[[[255,255,255],[0,0,0]]]]
expected: [[[255,255,239],[0,0,0]]]
Starter codePython
def sepia(image):
# Your code here
pass4 test cases · run your code against them in the editor