Ask Your Question

Kristiyan's profile - activity

2018-12-19 06:48:40 -0600 received badge  Supporter (source)
2018-12-19 06:41:04 -0600 marked best answer C++ imwrite png adds strange colors instead of transperancy

Hello everyone! All i want to do is resize and create new images from source image.Source png image is from PhotoShop.

This is how it looks in photoshop : image description

And in folder after resize and imwrite : image description

You can clearly see that the two copies have strange broders and colors.This happens with every .png which has transparent pixels.

Here is my code :

vector<int> compression_params;
compression_params.push_back(CV_IMWRITE_PNG_COMPRESSION);
compression_params.push_back(9);
resize(imageSource, dest1, Size(image.cols * 0.7028,image.rows*0.7028), 0, 0, INTER_AREA);
imwrite(fullPath, dest1, compression_params);
 resize(imageSource, dest2, Size(image.cols * 0.4685,image.rows*0.4685), 0, 0, INTER_AREA);
imwrite(fullPath, dest2, compression_params);

Is there anyone else with same problem or suggest how to fix it ? Thanks.

2018-12-19 06:41:04 -0600 received badge  Scholar (source)
2018-12-19 06:28:15 -0600 received badge  Editor (source)
2018-12-19 06:28:15 -0600 edited question C++ imwrite png adds strange colors instead of transperancy

C++ imwrite png adds strange colors instead of transperancy Hello everyone! All i want to do is resize and create new im

2018-12-19 06:26:46 -0600 asked a question C++ imwrite png adds strange colors instead of transperancy

C++ imwrite png adds strange colors instead of transperancy Hello everyone! All i want to do is resize and create new im