473,397 Members | 2,033 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,397 software developers and data experts.

Using CImg Library

1
dear all,
I am new in VC++ and CImg Library. I have two problems regarding the use of CImg commands:
1) How to convert RGB image into grayscale image? Is there a specific command in CImg which can do perform it?
2) How to write pixel values into notepad?

Looking forward to any replies. Thanks in advance.
Dec 9 '06 #1
1 6686
macklin01
145 100+
dear all,
I am new in VC++ and CImg Library. I have two problems regarding the use of CImg commands:
1) How to convert RGB image into grayscale image? Is there a specific command in CImg which can do perform it?
2) How to write pixel values into notepad?

Looking forward to any replies. Thanks in advance.
I don't use CImg myself, but I have done RGB -> grayscale conversions. Even if there is a built-in function, it's very easy to do on your own by manipulating the individual pixels. Although you'll need to modify the syntax to suit Cimg, this documentation contains sample code for RGB->gray using EasyBMP. (See page 4.) The relevant portion is here:

Expand|Select|Wrap|Line Numbers
  1. int Gray = (int) floor( 0.299*Input(i,j)->Red +
  2.                         0.587*Input(i,j)->Green +
  3.                         0.114*Input(i,j)->Blue );
  4.  
Notice the heaviest weight on green, followed by red and then blue. This is because the human eye is most sensitive to green, followed by red and then blue. ;) -- Paul
Dec 12 '06 #2

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

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
0
by: Richard Taylor | last post by:
User-Agent: OSXnews 2.07 Xref: number1.nntp.dca.giganews.com comp.lang.python:437315 Hi I am trying to use py2app (http://undefined.org/python/) to package a gnome-python application...
2
by: deepukutty | last post by:
Hi all, I know tht we can do tracing in two ways.one in application level and the other is at Page level. I am able to see the details of trace either on the page itself or .../trace.axd page....
6
by: =?Utf-8?B?WW9naSBXYXRjaGVy?= | last post by:
Hello, I am using Visual Studio-2003. I created a project to build my library. Since I am using third party libraries as well, I have specified those additional library dependencies in project...
6
by: TS | last post by:
I cannot get this to work. I added an app.config to a project i reference from my web application project (vs 05) but can see no way to access the settings within it. the other thing is that I...
18
by: Angus | last post by:
Hello We have a lot of C++ code. And we need to now create a library which can be used from C and C++. Given that we have a lot of C++ code using classes how can we 'hide' the fact that it is...
2
by: sanjoycs | last post by:
Hi I am new user of CImg, n it is my first posting here..:).... I wanna set RGB or HSV pixel value in a single pixel. like....In an image, at (x,y) coordinate I wanna assign my pixel value...
3
by: Bernard123456 | last post by:
Hi all, I am new to CImg. I would like to know how to obtain a pixel value on a specific coordinate. Thank in advance to all
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.