A high performance JPEG Encoder written in JavaScript