On-chip fast data sparsification for a monolithic 4096-pixel device