473,410 Members | 1,937 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,410 software developers and data experts.

R, G, B channels from RGB

3
Hello,

I have a .bmp image sequence. I need to read and convert the R, G, B components of all images in the sequence. I am following the classical way but it is too slow,

Expand|Select|Wrap|Line Numbers
  1. Color pixelcolor=mybmp->GetPixel(i,j);
And also I need to convert bit depth from 24 to 15. I am again following the classical way, in a loop for each pixel, but again it is too slow.

What is the fastest way to obtain these things?
May 26 '09 #1
2 2570
YarrOfDoom
1,247 Expert 1GB
I'd recommend you to do a search for "C++ bmp library" on the web. Things like these have been done before, and the results are usually better (don't let that stop you from trying to find a new way yourself though, there's always room for innovation).

I've found with a list of libraries related to image processing here.
May 29 '09 #2
RRick
463 Expert 256MB
If a standalone image processing program will suit your needs, Irfan view for windows is the best. Free, too.

Image toolkits are good and numerous, but have their own overhead. I wanted to use ImageMagic, but found that I was stuck with their representation. This did not suit my application.

This conversion/overhead might be the what's causing you trouble. GetPixel might be slowing you down. If you understand the underlying BMP structure, then you can speed things up by dealing with the data structure instead of pixel values. This puts more work on you, but the speed increases can be impressive.

In the case of BMP images, once you get pass the header, the data is simply a list of color values. I don't believe it uses any compression. All the data can be read into a string array with a single io call. That will speed things up. Once the data is in the array, you just sequentially step through and convert the values. Now its up to you to know how the RGB are stored.

As for the conversion from 24 bit color, remember that the 24 bit value is based on 3 independent colors (RGB). These 8 bit values can be converted separately. You can pre-compute a table that does this conversion, thus turning all the ugly math into a simple lookup in a table.
Jun 2 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Raseliarison nirinA | last post by:
hi all, i found an unanswered question at http://www.faqts.com/knowledge_base/index.phtml/fid/538 with possible response below. i've tried to send it at faqt.python but can't figure out how to...
1
by: Pord Frefect | last post by:
Hi, I was looking around for some Oracle help on IRC and came across two channels on DalNet. #Oracle and #dbaOracle. These channels are kinda quiet though. Does anyone else know of some active...
2
by: web1110 | last post by:
Hi y'all, I'm playing with C# again, trying to implement a remoted calculator exercise. If I include: using System.Runtime.Remoting.Channels.Http; I get the error:
5
by: Uchiha Jax | last post by:
Hello all, Given my general greenness when it comes to remoting and my desire to having something relatively stable up and running in the short term I have been considering the purchase of...
4
by: marcelino | last post by:
Hi, I have c# express beta I try to write the following using clause: System.Runtime.Remoting.Channels.Http; because I want to create a http channel. HttpChannel aJobChannel = new...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
0
by: Sebastian Loncar | last post by:
Hi, i have two applications, which communicates very extrem together. With the IPC-Channel i receive often the messages like "all instances of the requested pipe are busy". So i want to use...
1
by: james.cssa | last post by:
When I try to compile the following program on Visual Studio 2005 Pro, the namespace System.Runtime.Remoting.Channels.Tcp is not recongized by the compiler. (The "Tcp" part is highlighted.) And I...
3
by: breeto | last post by:
If you've configured .NET Remoting to use more than one channel of the same type, for example two TcpClientChannels with unique names, when you want to create a proxy to a remote object how do you...
3
by: sickboy | last post by:
$channels=$_GET; if (empty($channels)) { $channels='blank'; } changechannels($channels); $theatre=$_GET; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre); $info=$_GET; if...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.