Cannot call StartPaletteEditor()


I’m writing a simple program to read an image and calculate the centroid of a maximum…

I would like to have the same options as there is on the online example galaxy_image.C, where I call:


My macro is:

void Image()
TImage *image = TImage::Open(“Image.png”);
unsigned int yPixels = image->GetHeight();
unsigned int xPixels = image->GetWidth();
unsigned int *argb = image->GetArgbArray();

printf(“The image is %d x %d pixels with %d Digital Levels\n”,yPixels,xPixels,*argb);

//TH2D* h = new TH2D(“h”,“Image Histogram”,xPixels,-1,1,yPixels,-1,1);

for(int row=0;row<xPixels;++row){
for(int col=0;col<yPixels;++col){
Centroid calculus…


When I start the program, ROOT tells me:
“Warning in TASImage::StartPaletteEditor: palette can be modified only for data images”

How can I set the editor? Sorry, I’m still a beginner?

Thank you very much.

is galaxy_image.C working for you ?


Yes, it is working quite normal.

When I run my program, ROOT visualizes the image (attached), but it doesn’t start the palette editor.

Thank again.

So, if for you the galaxy example is working just do the same and it should work …