The skiptake.XXX file provides a skip-take list for cropped lev1 images with image configuration id XXX. The skip-take list is an ASCII file containing exactly 4096 pairs of (skip,take) values defining the cropped region of a lev1 image. The first pair of values is for the bottom row of the image. The code below reads a lev1 cropmask on stdin and writes the skip-take list on stdout. ============= /home/kehcheng/work/hmicomp/makeskiptake.c ============== #include main() { int i,j,skip,take; char mask[16777216]; fread(mask,1,16777216,stdin); for (i=0;i<4096;++i) { skip = take = 0; for (j=0;j<4096;++j) { if (mask[i*4096+j]) break; ++skip; } for (j=skip;j<4096;++j) { if (!mask[i*4096+j]) break; ++take; } printf("%d %d\n",skip,take); } }