path = "$desktop/temp/";
files = Files In Directory( path );
For( ifile = 1, ifile <= N Items( files ), ifile++,
filename = files[ifile];
If( Right( filename, 4 ) == ".jpg",
pic = Open( path || filename, "jpg" );
jslcolor = pic << getpixels();
{red, green, blue} = Color To RGB( jslcolor );
{hue, lightness, saturation} = Color To HLS( jslcolor );
nr = N Rows( jslcolor );
nc = N Cols( jslcolor );
dt = New Table( Substr( filename, 1, Length( filename ) - 4 ),
addrows( nr * nc ),
New Column( "x" ),
New Column( "y" ),
New Column( "red", setvalues( red ) ),
New Column( "green", setvalues( green ) ),
New Column( "blue", setvalues( blue ) ),
New Column( "hue", setvalues( hue ) ),
New Column( "lightness", setvalues( lightness ) ),
New Column( "saturation", setvalues( saturation ) ),
);
irow = 0;
For( iy = 1, iy <= nr, iy++,
For( ix = 1, ix <= nc, ix++,
irow++;
dt:y[irow] = iy;
dt:x[irow] = ix;
)
);
// do something with dt
Wait( 1 );
Close( dt, "nosave" );
);
);
Craige