瀏覽代碼

Tests/LibGfx: Add YCCK jpeg test files

Obtained by running:

    convert rgb_components.jpg -colorspace cmyk \
        -sampling-factor 1 ycck-1111.jpg
    convert rgb_components.jpg -colorspace cmyk \
        -sampling-factor 2 ycck-2111.jpg
    convert rgb_components.jpg -colorspace cmyk ycck-2112.jpg

where rgb_components.jpg is the file in Tests/LibGfx/test-inputs/jpg.

(I used the web version of `convert` at
https://cancerberosgx.github.io/magic/playground/index.html)

While this does indeed produce a cmyk jpg (using the YCCK encoding
internally), it uses the mathematical rgb->cmyk conversion and does
not embed an cmyk color space in the output jpg.

Normally, cmyk images are for printing and hence converting them
from cmyk to rgb using a color profile like SWOP leads to better
results. So if a cmyk image does not contain color space information,
applications might use something like SWOP instead of the simple
math transform to convert to RGB. Programs doing that will show
these images as fairly muted (and would arguably be correct doing
so).

Hence, tests using these images shouldn't check their RGB values.
Ideally, we'd add a way to get the raw cmyk data from a cmyk jpeg,
and then tests could test color values against that.

The -1111 image uses no subsampling, meaning each channel's sampling
factor is 1.

The -2111 image uses subsampling for the non-Y channels, meaning the
sampling factors are 2 for Y and 1 each for YYK.

The -2112 image uses subsampling for the two C channels, meaning the
sampling factors are 2 for Y and K and 1 each for YY.

We correctly render the -1111 variant (using e.g.
`Build/lagom/bin/image -o out.png .../ycck-1111.jpg).

We render the -2111 variant, but it looks pretty broken.

We refuse to decode the -2112 variant. This is #21259.

Manual tests for now, but having these in tree will make it easier
to write unit tests later, once things work better.
Nico Weber 1 年之前
父節點
當前提交
e735ee5251
共有 3 個文件被更改,包括 0 次插入0 次删除
  1. 二進制
      Tests/LibGfx/test-inputs/jpg/ycck-1111.jpg
  2. 二進制
      Tests/LibGfx/test-inputs/jpg/ycck-2111.jpg
  3. 二進制
      Tests/LibGfx/test-inputs/jpg/ycck-2112.jpg

二進制
Tests/LibGfx/test-inputs/jpg/ycck-1111.jpg


二進制
Tests/LibGfx/test-inputs/jpg/ycck-2111.jpg


二進制
Tests/LibGfx/test-inputs/jpg/ycck-2112.jpg