Darktable darkens images automatically and can not be reset

Normally, I export 100% quality JPEG files from Photoshop, import the JPEG files into Darktable, and then execute watermarks, etc., before exporting them back to JPEG files with about 70% quality.

When I import a file in Darktable 2.6.2, it automatically darkens. Example below

Enter image description here

Darktable preview on the left, original JPEG image in 100% quality right.

In darktable, I have not assigned a module to the image. I just open the picture and have darkened the picture.

I checked the history stack. There was nothing applied. But something was applied with force that I can not turn off.

What's happening? Is it a bug or something?

I reset Darktable (deleted rm ~ / .config / darktable / * After reloading and importing a file, the image automatically darkens.

Matrices – Python Image Folding – image darkens

I use kernel convolution in Python to blur a picture, but in addition to blurring, it also gets darker. Could someone help me, why?

def convolve (pixels, kernels, i, j):
R = 0
G = 0
B = 0
if I have <2 or j<2 or i>= Height-2 or j> = width-2:
R = pixels[i][j][0]
    
    
    
    G = pixel[i][j][1]
    
    
    
    B = pixels[i][j][2]



otherwise:
# Pixels[][][R/G/B]
    
    
    
    R = (
pixel[i-2][j-2][0]    * Kernel[0][0]    + Pixels[i-2][j-1][0]    * Kernel[0][1]    + Pixels[i-2][j][0]    * Kernel[0][2]    + Pixels[i-2][j+1][0]    * Kernel[0][3]    + Pixels[i-2][j+2][0]    * Kernel[0][4]    +
pixel[i-1  ][j-2][0]    * Kernel[1][0]    + Pixels[i-1  ][j-1  ][0]    * Kernel[1][1]    + Pixels[i-1  ][j][0]    * Kernel[1][2]    + Pixels[i-1  ][j+1][0]    * Kernel[1][3]    + Pixels[i-1  ][j+2][0]    * Kernel[1][4]    +
pixel[i][j-2][0]    * Kernel[2][0]    + Pixels[i][j-1][0]    * Kernel[2][1]    + Pixels[i][j][0]    * Kernel[2][2]    + Pixels[i][j+1][0]    * Kernel[2][3]    + Pixels[i][j+2][0]    * Kernel[2][4]
    
    
    
    )

G = (
pixel[i-2][j-2][1]    * Kernel[0][0]    + Pixels[i-2][j-1][1]    * Kernel[0][1]    + Pixels[i-2][j][1]    * Kernel[0][2]    + Pixels[i-2][j+1][1]    * Kernel[0][3]    + Pixels[i-2][j+2][1]    * Kernel[0][4]    +
pixel[i-1  ][j-2][1]    * Kernel[1][0]    + Pixels[i-1  ][j-1  ][1]    * Kernel[1][1]    + Pixels[i-1  ][j][1]    * Kernel[1][2]    + Pixels[i-1][j+1][1]    * Kernel[1][3]    + Pixels[i-1  ][j+2][1]    * Kernel[1][4]    +
pixel[i][j-2][1]    * Kernel[2][0]    + Pixels[i][j-1][1]    * Kernel[2][1]    + Pixels[i][j][1]    * Kernel[2][2]    + Pixels[i][j+1][1]    * Kernel[2][3]    + Pixels[i][j+2][1]    * Kernel[2][4]
    
    
    
    )

B = (
pixel[i-2][j-2][2]    * Kernel[0][0]    + Pixels[i-2][j-1][2]    * Kernel[0][1]    + Pixels[i-2][j][2]    * Kernel[0][2]    + Pixels[i-2][j+1][2]    * Kernel[0][3]    + Pixels[i-2][j+2][2]    * Kernel[0][4]    +
pixel[i-1  ][j-2][2]    * Kernel[1][0]    + Pixels[i-1  ][j-1][2]    * Kernel[1][1]    + Pixels[i-1][j][2]    * Kernel[1][2]    + Pixels[i-1][j+1][2]    * Kernel[1][3]    + Pixels[i-1  ][j+2][2]    * Kernel[1][4]    +
pixel[i][j-2][2]    * Kernel[2][0]    + Pixels[i][j-1][2]    * Kernel[2][1]    + Pixels[i][j][2]    * Kernel[2][2]    + Pixels[i][j+1][2]    * Kernel[2][3]    + Pixels[i][j+2][2]    * Kernel[2][4]
    
    
    
    )

# if <0, then 0
R = R*(R>0)
G = G * (G> 0)
B = B * (B> 0)

R = R if R <256, otherwise 255
G = G if G <256, otherwise 255
B = B if B<256 else 255


# if >255, then 255
if R<0 or R>255 or G<0 or G>255 or B<0 or B>255:
Pressure (R, G, B)
Return (Round (R), Round (G), Round (B))

The kernel I use is a 5×5 Gaussian Blur from Wikipedia

MacBook Pro 2016. The screen darkens as you expand the display panel.

My MBP screen gets darker as you expand the display area and turn blacker than 70 degrees. I have seen that this problem is being addressed by other people. No solution has been suggested except to replace the screen. Why does the "revered" Apple company not recognize that this is a known issue and provide an exception for the repair? It's frustrating to spend a fortune on a notebook just to see it fail in 15 months (I've had dark streaks at the bottom of the screen in the last 6 months but thought it might be a temporary problem )
The screen costs half of the notebook (an amount that pays 3 months rent of my apartment in India).
All I can say is "SHAME ON THEM".
Apple products are not what they were. It's time for people to see through the hype.