On my path to gaining proficiency in ecmascript6, I am exercising with a windows bitmap decoder, spatial convolution and bokeh effect filter.
Windows Bitmap decoder
This decoder is capable only of loading 24bpp uncompressed RGB image from your local drive at current. The source code is based on a comprehensive version written in actionscript back in August 1, 2009. The Windows 3.x Bitmap format (BMP) is defined by four sections below. Please consider reference text below for detail.
- BITMAP File-Header
- Bitmap Info (Bitmap Info-header)
- Bitmap palette (if exists)
- BITMAP-Picture data
Filters, blur, laplacian and sharpen have been implemented for testing. For blur, a RECT function of 5×5 kernel is set for default and configurable. For laplacian, it is an isotropic derivative filter for detecting high frequencies. It has a 3×3 kernel [-1, -1, -1, -1, 8, -1, -1, -1, -1]. For sharpening, the high frequency result from a laplacian filter is added to an identity. Please consider reference text below for detail and mathematics.
At the center of the image, an identity kernel is applied. As the convolution is applied on pixels away from center, a larger RECT function is utilized. Illustrated in the above kernel graph on the right, black spot marks the identity kernel and lighter intensity mark larger kernels. Source code is available on Github.
Currently working on code quality which includes ES6 modules to divide decoder from filter. Also, large format camera, scheimpflug principle, is being implemented to simulate a plane shift image effect.
- Digital Image Processing by Rafael C. Gonzalez, Richard E. Woods, Addison Wesley Publishing, 1992. ISBN 0-201-50803-6
- The file formats handbook by Gunter Born, International Thomson computer press, 1995. ISBN 1-850-32128-0