longtimeago 0 Report post Posted September 13, 2008 hello friends i am doing a project , in that i am inneed to fine the mean RGB value of a particular image , is there any program in any language which can do this ? the input to the program will be any image ( can be linked in the program) and the putput must be the mean RGB value of that particular image , is this Possible ? If so please post the Coding , no matter in what ever language it may be written.Thanks in Advance Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted September 13, 2008 Check this php function http://ca3.php.net/manual/en/function.imagecolorat.phpRequires the GD Library, which is fairly standard for a PHP installation.User Notes at that link include some scripts. Share this post Link to post Share on other sites
longtimeago 0 Report post Posted September 16, 2008 Thank you for your help and i have found a solution, the same can be obtained using C# , C# has an inbuilt class known as the Bitmap and with C# i was successfully able to code a program to get the mean RGB color by giving the Image location as input. Share this post Link to post Share on other sites
bluedragon 0 Report post Posted September 18, 2008 You can also do that in C++ using CImg library.. Share this post Link to post Share on other sites
iGuest 3 Report post Posted October 8, 2008 Please help Finding The Rgb Color Of An Image Replying to nirmaldaniel Dear Nirmaldaniel, I read your reply on the C++ used for the color detection. If possible Could be please send me the codes coz I am also looking for similar probelm. Thank you..Please help me Catherine -question by Catherine Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 13, 2008 !!!HelpFinding The Rgb Color Of An ImageReplying to bluedragon Dear BrotherI want to take some information about the RGB file.How can I read the RGB file and also tell me how I create the new RGB file in C/ C++.I will thanks to you -Muhammad Mohsan Shabbir Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 7, 2009 RGB creation and recreation ...Finding The Rgb Color Of An ImageI have below VB program which can segregate the are G B values and the same tries to recreate as the original file. Recreation is done using C++; if you want you can collect it from me. Dim bmpObj As Object Set bmpObj = CreateObject("jpeg.CJpegImage") 'CALL COMImageSize (Me.ImgJPG.ScaleWidth, Me.ImgJPG.ScaleHeight) bmpObj.SetFormatSize Me.PicSourceImage.ScaleWidth, Me.PicSourceImage.ScaleHeight With picSourceImage For ctrY = 0 To Me.PicSourceImage.ScaleHeight - 1 For ctrX = 0 To Me.PicSourceImage.ScaleWidth - 1 Pixel = GetPixel(.HDC, ctrX, ctrY) myGRed(ctrX, ctrY) = RgbColor(Pixel).Red myGGreen(ctrX, ctrY) = RgbColor(Pixel).Green myGBlue(ctrX, ctrY) = RgbColor(Pixel).Blue bmpObj.SetJpegImageData myGRed(ctrX, ctrY), myGGreen(ctrX, ctrY), myGBlue(ctrX, ctrY) Next ctrX Next ctrY End With bmpObj.SaveJpegImage (App.Path & "ProcessedImage" & Left(Me.TxtFileName.Text, InStr(1, Me.TxtFileName.Text, ".") - 1) & ".Jpg")-reply by Srinivasan Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 2, 2009 conversion of rgb to hsiFinding The Rgb Color Of An ImageReplying to (G)SrinivasanI am doing this project actually showing a movie in opengl but I am using the green screen where I need to convert the rgb of the pictures to hsi in c++ and reverse. Can you help me? -reply by pugsy Share this post Link to post Share on other sites
nooc9 0 Report post Posted December 8, 2009 (edited) As this was posted in C/C++ I feel it should be mentioned that if on windows, there are the windows GDI functions/classes to use and thus, no need for 3rd party libs or .NET. #include <gdiplus.h>...Bitmap* bm = new Bitmap("image.jpg");...// bm->LockBits() or bm->GetPixel()...delete bm;... Edited December 8, 2009 by nooc9 (see edit history) Share this post Link to post Share on other sites