I'm working on a grayscale .tif file:
I convert it to BGR and try to draw some colorful stuff on it. If I save the result as .png, it's all still in shades of gray, including the drawn elements. If I save it as .jpg, colors of them are okay, but the rest of image is a lot brighter than it was, which I definitely don't want to happen.
simplified example of what I'm trying to do:
def draw_lines(image_path):
image = cv2.cvtColor(cv2.imdecode(np.fromfile(image_path, dtype=np.uint8), cv2.IMREAD_UNCHANGED), cv2.COLOR_GRAY2BGR)
cv2.line(image, (0,10), (image.shape[1], 1000), (0, 255, 0), 10)
cv2.imwrite("result.jpg", image)