-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
BMP image not loading correctly #23445
Copy link
Copy link
Closed
Labels
affected: 3.4bugcategory: imgcodecsconfirmedThere is stable reproducer / investigation completeThere is stable reproducer / investigation complete
Milestone
Description
System Information
OpenCV version: 4.7.0
Operating System: Arch Linux
Compiler: GCC 12.2.1
Detailed description
For this particular BMP image (attached as a gz file since Github is not allowing BMP upload)
output.bmp.gz
OpenCV is not able to load that particular image correctly. When loading with image = imread( argv[1], IMREAD_UNCHANGED ); I see very dark image with low brightness:

and when loading with image = imread( argv[1], IMREAD_COLOR ); I see the below:

Both of which are different from normally what MacOS image viewer or Eye of Mate on Linux shows:

Steps to reproduce
Load the output.bmp image via the below c++ opencv program and change the imread argument to observe the image displayed.
#include <iostream>
#include <cstdio>
#include <opencv2/opencv.hpp>
using namespace cv;
int main(int argc, char** argv )
{
if ( argc != 2 )
{
printf("usage: DisplayImage.out <Image_Path>\n");
return -1;
}
Mat image;
//image = imread( argv[1], IMREAD_COLOR );
image = imread( argv[1], IMREAD_UNCHANGED );
if ( !image.data )
{
printf("No image data \n");
return -1;
}
namedWindow("Display Image", WINDOW_AUTOSIZE );
imshow("Display Image", image);
waitKey(0);
return 0;
}Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affected: 3.4bugcategory: imgcodecsconfirmedThere is stable reproducer / investigation completeThere is stable reproducer / investigation complete