473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Reading in a bitmap and getting RGB values

I am trying to use ANSI C to read in a bitmap and for each x,y value
get a value for the R, G, and B channels. What would be the best way
to go about this? I had some code working but it would not work for
images larger than 640x480 it would just crash. I have tried using the
Microsoft bmp.c/bmp.h code as well as something called ImageFmtc.c/
ImageFmtc.h and either receive unexpected results or program crashes
on large images.

Thanks for the advise/help on the topic!
Aug 13 '08 #1
2 3629

"steve" <St******************@gmail.comwrote in message news
>I am trying to use ANSI C to read in a bitmap and for each x,y value
get a value for the R, G, and B channels. What would be the best way
to go about this? I had some code working but it would not work for
images larger than 640x480 it would just crash. I have tried using the
Microsoft bmp.c/bmp.h code as well as something called ImageFmtc.c/
ImageFmtc.h and either receive unexpected results or program crashes
on large images.
Go to my website. Under Basic Algorithms there are readers / writers for
BMP. GIF and JPEG formats.
Any computer will run out of memory if images are big enough. However in
this day and age 480*640 shouldn't be a problem, unless you have a really
old computer / compiler.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Aug 13 '08 #2
steve pisze:
I am trying to use ANSI C to read in a bitmap and for each x,y value
get a value for the R, G, and B channels. What would be the best way
to go about this? I had some code working but it would not work for
images larger than 640x480 it would just crash. I have tried using the
Microsoft bmp.c/bmp.h code as well as something called ImageFmtc.c/
ImageFmtc.h and either receive unexpected results or program crashes
on large images.

Thanks for the advise/help on the topic!
http://local.wasp.uwa.edu.au/~pbourke/dataformats/bmp/

http://entropymine.com/jason/bmpsuite/
http://fraktal.republika.pl/g_file.html

What do you think about PPM file ?

HTH

Adam
Aug 15 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Dean | last post by:
Ok i had a method for finding the colours in a bitmap file but its very inefficient so i will have to go through each bit individually and check its value. I will have to go through the bytes in...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
0
by: Marc Pelletier | last post by:
Hello, I am rolling my own bitmap class. One of the things it needs to do is return a given pixel. I have a reference to the BITMAP structure which gives the address of the starting bit, the...
5
by: Lance | last post by:
I need to create a Drawing.Bitmap from an array of integer values. My current technique creates a bitmap that eventually becomes corrupt (i.e., the bitmap's pixels change to a different color...
1
by: B. Cline | last post by:
Hi, I need to write a conversion routine to split pictures out of about 10000 word documents. (Actually the text is converted to RTF, the pictures should be converted to jpg). I thought I...
7
by: chuck | last post by:
I load a bitmap using GDI+ now, I want to collect all the pixel values, (in RGB but without the A component) onto a color array, say... dim btmp1(,) as color is there a method that can help me...
5
by: Marco Castro | last post by:
Along time ago I created an access database where I used the ole field type to store images. If I look at the table data it has the work Picture in its field. The image in that field displays...
1
by: bongoo | last post by:
I'm reading pixel values (RGB) from a bitmap object using function from system.drawing namespace & vb.net (.net framework 1.1) But I would like to make it faster, so is there any another way of...
2
by: JoeC | last post by:
I am trying to create a graphic library that read bitmap info from a fil this dosn't seem to worlk, it read in the first two values but dosn't seem to read the graphic data am I doing this wrong? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.