# Revision history [back]

### Does the latest OpenCV handle PNG files *properly*??

For a long time, I have tried to write a very simple OpenCV application, using variations of the code below. I prefer the PNG graphics format, but the code works erratically: sometimes I get a line, sometimes I get a black (empty) rectangle. If I use JPG or BMP, the program works fine.

TIA,

-Ramon

ps: My current version is OpenCV 2.1

# include <opencv highgui.h="">

IplImage* image = cvCreateImage(cvSize(int(8.572), 1172), IPL_DEPTH_16U, 4); cvLine(image, cvPoint(22, 44), cvPoint(456, 700), CV_RGB(255, 0, 0)); cvSaveImage("my_image.bmp", image);

### Does the latest OpenCV handle PNG files *properly*??

For a long time, I have tried to write a very simple OpenCV application, using variations of the code below. I prefer the PNG graphics format, but the code works erratically: sometimes I get a line, sometimes I get a black (empty) rectangle. If I use JPG or BMP, the program works fine.

TIA,

-Ramon

ps: My current version is OpenCV 2.1

# include cv.h=""> //#include <opencv highgui.h="">

IplImage* image = cvCreateImage(cvSize(int(8.572), 1172), IPL_DEPTH_16U, 4); cvLine(image, cvPoint(22, 44), cvPoint(456, 700), CV_RGB(255, 0, 0)); cvSaveImage("my_image.bmp", image);

### Does the latest OpenCV handle PNG files *properly*??

For a long time, I have tried to write a very simple OpenCV application, using variations of the code below. I prefer the PNG graphics format, but the code works erratically: sometimes I get a line, sometimes I get a black (empty) rectangle. If I use JPG or BMP, the program works fine.

TIA,

-Ramon

ps: My current version is OpenCV 2.1

//#include <opencv cv.h=""> //#include <opencv highgui.h="">

IplImage* image = cvCreateImage(cvSize(int(8.572), 1172), IPL_DEPTH_16U, 4); cvLine(image, cvPoint(22, 44), cvPoint(456, 700), CV_RGB(255, 0, 0)); cvSaveImage("my_image.bmp", image);

### Does the latest OpenCV handle PNG files *properly*??

For a long time, I have tried to write a very simple OpenCV application, using variations of the code below. I prefer the PNG graphics format, but the code works erratically: sometimes I get a line, sometimes I get a black (empty) rectangle. If I use JPG or BMP, the program works fine.

TIA,

-Ramon

ps: My current version is OpenCV 2.1

IplImage* image = cvCreateImage(cvSize(int(8.572), 1172), IPL_DEPTH_16U, 4); 4);

cvLine(image, cvPoint(22, 44), cvPoint(456, 700), CV_RGB(255, 0, 0)); 0));

cvSaveImage("my_image.bmp", image);

### Does the latest OpenCV handle PNG files *properly*??

For a long time, I have tried to write a very simple OpenCV application, using variations of the code below. I prefer the PNG graphics format, but the code works erratically: sometimes I get a line, sometimes I get a black (empty) rectangle. If I use JPG or BMP, the program works fine.

TIA,

-Ramon

ps: My current version is OpenCV 2.1

IplImage* image = cvCreateImage(cvSize(int(8.572), 1172), IPL_DEPTH_16U, 4);

cvLine(image, cvPoint(22, 44), cvPoint(456, 700), CV_RGB(255, 0, 0));

cvSaveImage("my_image.bmp", cvSaveImage("my_image.png", image);

### Does the latest OpenCV handle PNG files *properly*??

For a long time, I have tried to write a very simple OpenCV application, using variations of the code below. I prefer the PNG graphics format, but the code works erratically: sometimes I get a line, sometimes I get a black (empty) rectangle. If I use JPG or BMP, the program works fine.

TIA,

-Ramon

ps: My current version is OpenCV 2.1

IplImage* image = cvCreateImage(cvSize(int(8.572), 1172), cvCreateImage(cvSize(int(8.5x72), 11x72), IPL_DEPTH_16U, 4);

cvLine(image, cvPoint(22, 44), cvPoint(456, 700), CV_RGB(255, 0, 0));

cvSaveImage("my_image.png", image);

 7 improved style Martin Peris 1722 ●9 ●23 http://blog.martinperi...

### Does the latest OpenCV handle PNG files *properly*??

For a long time, I have tried to write a very simple OpenCV application, using variations of the code below. I prefer the PNG graphics format, but the code works erratically: sometimes I get a line, sometimes I get a black (empty) rectangle. If I use JPG or BMP, the program works fine.

TIA,

-Ramon

ps: My current version is OpenCV 2.1

IplImage* image = cvCreateImage(cvSize(int(8.5x72), 11x72), IPL_DEPTH_16U, 4); 4);
cvLine(image, cvPoint(22, 44), cvPoint(456, 700), CV_RGB(255, 0, 0)); 0));
cvSaveImage("my_image.png", image);image);

 8 retagged sturkmen 6076 ●3 ●42 ●71 https://github.com/stu...

### Does the latest OpenCV handle PNG files *properly*??

For a long time, I have tried to write a very simple OpenCV application, using variations of the code below. I prefer the PNG graphics format, but the code works erratically: sometimes I get a line, sometimes I get a black (empty) rectangle. If I use JPG or BMP, the program works fine.

TIA,

-Ramon

ps: My current version is OpenCV 2.1

IplImage* image = cvCreateImage(cvSize(int(8.5x72), 11x72), IPL_DEPTH_16U, 4);
cvLine(image, cvPoint(22, 44), cvPoint(456, 700), CV_RGB(255, 0, 0));
cvSaveImage("my_image.png", image);