In this paper we present a system for high speed pixelwise spectral classification. The system is based on the line imaging PGP (prism-grating-prism) spectrograph combined with the smart image sensor MAPP2200. The classification is implemented using a near-sensor approach where linear discriminant functions are calculated using exposure time modulation and analog summation of pixel data. After A/D-conversion the sums are compared and classified pixels are output from the sensor chip. The theoretical maximum classified pixel rate of the system is around 1 MHz depending on number of classes, etc. In most practical applications however, the limit will be set by the available amount of light.