Content-Encoding: gzip implies a gz header. zlib.deflate just deflates and emits headerless data. Because creating a valid header requires the length of the content to be known, there's no stream filter in PHP to create a gz header.
To see Chrome decode your test image, use gzencode() or set Content-Encoding to deflate.
Source:
<?php
header('Content-Encoding: gzip');
header('Content-Type: image/jpeg');
$fin = fopen('test.jpg', "rb");
$fout = fopen('php://output', "w");
$gzipFilter = stream_filter_append($fout, 'zlib.deflate', STREAM_FILTER_WRITE, array('level' => 6, 'window' => 15, 'memory' => 9));
stream_copy_to_stream($fin, $fout);
stream_filter_remove($gzipFilter);
fclose($fin);
fclose($fout);