|
-
February 8th, 2006, 08:31 AM
#1
CImg library
Hi everyono, I am using CImg library, and have a problem. I constructed 48*32 grayscale imag with:
CImg<double> image(48,32,1,1,0);
After that if, for instance i want to put some pixel to values 126, i use:
for(int i=0;i<48;i++){
for(int j=0;j<3;j++){
image(i,j)=126;}}
and than try to display that by:
CImgDisplay display(image);
All i get is black and white image, and i want to get a grayscale image, Can somebody tell what am i doing wrong.
Thanks in advance
Uros
-
February 8th, 2006, 09:32 AM
#2
-
February 8th, 2006, 09:37 AM
#3
Re: CImg library
perhaps you should try to change the value to 0.5 instead of 126. When graphics libraries use doubles or floating points the values often go from 0 to 1 instead of 0 to 255.
-
December 9th, 2006, 07:35 AM
#4
Re: CImg library
halo,
I would like to know did u get to convert the RGB images into grayscale images? im a newbie n im currently facing d problem n hope u can help if u've figured out how 2do it.
thanks.
-
December 9th, 2006, 11:53 AM
#5
Re: CImg library
There are many formulas but a common one is
greyscale = 0.3 * red + 0.59 * green + 0.11 * blue
This thread is ancient, there is no reason for you to have revived it.
Windows XP, Visual Studio 2008, SVN
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|