change formula of calculating bp.gray.rshift value on PNG_COLOR_TYPE_GRAY
implement encode-as-JPEG-format function named encode_jpeg