int rows = sampleGrid.getYMax() - sampleGrid.getYMin() + 1;
int channels = 4; // Hard-coded to RGBA
// We force to 8 bits channel depth, some clients won't support more than 8
// (namely, HTML5 canvas...)
ImageInfo imgInfo = new ImageInfo(cols, rows, 8, true, false, false);
/**
* TODO: PNGJ allow for progressive (ie line-by-line) writing. Thus we could theorically
* prevent having to allocate a bit pixel array in the first place, but we would need a
* line-by-line iterator on the sample grid, which is currently not the case.
*/