Questions tagged [bmp]

The BMP File Format, also known as Bitmap Image File or Device Independent Bitmap (DIB) file format or simply a Bitmap, is a Raster graphics image file format used to store bitmap digital images, independently of the display device (such as a graphics adapter), especially on Microsoft Windows and OS/2 operating systems.

The BMP File Format, also known as Bitmap Image File or Device Independent Bitmap (DIB) file format or simply a Bitmap, is a Raster graphics image file format used to store bitmap digital images, independently of the display device (such as a graphics adapter), especially on Microsoft Windows and OS/2 operating systems.

More information at Wikipedia page of BMP

1091 questions
12
votes
7 answers

How can I read BMP pixel values into an array?

I'm writing code in C++ (on Windows) and I'm trying to extract the pixel values of a grayscale bmp. I don't care about keeping any of the metadata, and just want to store the pixel values in a char array. I haven't been able to find a standard or…
11
votes
3 answers

Why does fread mess with my byte order?

Im trying to parse a bmp file with fread() and when I begin to parse, it reverses the order of my bytes. typedef struct{ short magic_number; int file_size; short reserved_bytes[2]; int data_offset; }BMPHeader; ... BMPHeader…
Chase Walden
  • 1,252
  • 1
  • 14
  • 31
11
votes
7 answers

C++: What's the simplest way to read and write BMP files using C++ on Windows?

I would like to load a BMP file, do some operations on it in memory, and output a new BMP file using C++ on Windows (Win32 native). I am aware of ImageMagick and it's C++ binding Magick++, but I think it's an overkill for this project since I am…
Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
11
votes
2 answers

C++ Image Processing - Reading an Image file into 2D Array

I'm an absolute noobie at C++ as I've only been familiar with Java programming. What I'm trying to do is to read an Image file (.bmp) into a matrix where I can perform a convolution with a 3x3 matrix (filter) on the matrix to produce a new image…
MathanMV
  • 412
  • 1
  • 5
  • 16
10
votes
1 answer

working with .bmp files in python 3

I have a bmp file. It is just a red square. I have to write a program with functions to make it have white stripes. Things I would need to do: load the bmp file. read and assess the bmp file. code certain areas coordinates of the file to be colored…
amin
  • 429
  • 4
  • 8
  • 15
10
votes
3 answers

How to generate a dynamic GRF image to ZPL ZEBRA print

I have a problem. I´m generating a dynamic BMP image and trying to send this to a ZEBRA printer by ZPL commands. I need to convert my BMP to a GRF image. I think that my Hexadecimal extracted by the BMP image isn´t correct. The printed image is…
lucasrhuan
  • 119
  • 1
  • 1
  • 6
9
votes
2 answers

How to capture part of the screen and save it to a BMP?

Possible Duplicate: how to make screen screenshot with win32 in c++? I am currently trying to create an application that saved a portion of the screen to a bmp. I have found BitBlt but I really don't know what to do with it. I have tried…
Anton
  • 1,435
  • 2
  • 10
  • 21
9
votes
5 answers

Replacing icon in Windows *.exe from open-source platform-independent Java code

First of all, this is not a duplicate of the very common question of making an EXE from Java classes. I do not need to do that. To solve NetBeans RFE #64612 without manual steps I need a Java (6+) library which can take an existing Windows *.exe…
Jesse Glick
  • 24,539
  • 10
  • 90
  • 112
9
votes
4 answers

Android : save a Bitmap to bmp file format

I have a Bitmap in memory and I need to save it in a bmp file (using the bmp file format). Is there any way to do it on Android ? (I read a lot of post suggesting to use the png format - which is loss-less - but, that's not what I need: I really…
ben75
  • 29,217
  • 10
  • 88
  • 134
9
votes
3 answers

Storing a BMP image in a QR code

I'm trying to create (or, if I've somehow missed it in my research, find) an algorithm to encode/decode a bmp image into/from a QR code format. I've been using a guide (Thonky) to try to understand the basics of QR codes and I'm still not sure how…
user1748532
  • 91
  • 1
  • 1
  • 2
9
votes
1 answer

Unexpected return value from fread()

#include #include #include int main() { FILE* bmp = NULL; uint32_t offset; uint8_t* temp = NULL; size_t read; unsigned int x_dim = 600, y_dim = 388; bmp = fopen("test_colour.bmp", "r"); …
simon
  • 1,125
  • 1
  • 10
  • 20
8
votes
3 answers

reading a .bmp file in c++

I'm trying to load a bmp file for reusing it in opengl. I've found some code via google on how to load a bmp file. I took this code and put in a class Bitmap in my project. The class is far away from being finished but already the reading of the…
soupdiver
  • 3,504
  • 9
  • 40
  • 68
8
votes
3 answers

Why doesn't ImageIO read a BMP file until it is re-saved in MS Paint?

I have a bitmap file, test3.bmp, which I can view and edit with every image viewer I have tested with. That said, I cannot read it into my Java application. If I edit the BMP in MS Paint, save it, undo the change, and save it (test3_resaved.bmp), I…
Thomas Eding
  • 35,312
  • 13
  • 75
  • 106
8
votes
2 answers

BufferedImage to BMP in Java

I have a BufferedImage object and I want to encode it to the BMP format and save it to disk. How do I do this? In JPEG it's ok: BufferedImage img; //here is an image ready to be recorded into the hard disk FileOutputStream fout = new…
Eduardo Abreu
  • 245
  • 2
  • 3
  • 9
8
votes
1 answer

java Buffered Image : Detecting black pixels

I have this simple code to go through a 24bit color windows bmp file BufferedImage mapa = BMPDecoder.read(new File("maps/map.bmp")); final int xmin = mapa.getMinX(); final int ymin = mapa.getMinY(); final int ymax = ymin +…
Tom
  • 43,810
  • 29
  • 138
  • 169
1
2
3
72 73