Weird block on images on read

Hi!
I am having some weird issues when reading certain files.
Here is the original image as well as the one opencv saves (Latter is the one with the orange block on it). I don’t know why it saves with a big orange block on it.
Code is only this:
opencvtest - Pastebin.com

Image: Imgur: The magic of the Internet

Thanks for any help!

Hi,
You can past your code in your question.
Is your link good?

Code is:

import numpy as np
import cv2
cv2.imwrite("testplain.png", im)

I saw that the images was missing, added it now

please do NOT use external bins for code or images, put it all HERE, thank you.

(also, imgur is some shit site, blocked in several countries for a good reason…)

What is im?
opencv does not manage transparency. Display results are differents.

Hi! Since I am a new user, I cant upload images to post yet.
Complete code is updated here:
im = cv2.imread(‘tekst.png’)
cv2.imwrite(“testplain.png”, im)

this is the key.

your data seems to contain transparency.

if you use OpenCV’s imread and imwrite, you have to ask these functions to keep the fourth channel.

if you don’t, the pixels that would be transparent (their RGB values don’t matter), suddenly become opaque, and their RGB values are revealed!

This was the solution! Thanks everyone