From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../tests/jpegxl/3x3_jpeg_recompression-ref.html | 4 ++ .../tests/jpegxl/3x3_jpeg_recompression.html | 8 +++ .../tests/jpegxl/3x3_srgb_lossless-ref.html | 4 ++ .../tests/jpegxl/3x3_srgb_lossless.html | 8 +++ .../tests/jpegxl/3x3_srgb_lossy-ref.html | 4 ++ .../web-platform/tests/jpegxl/3x3_srgb_lossy.html | 8 +++ .../tests/jpegxl/3x3a_srgb_lossless-ref.html | 4 ++ .../tests/jpegxl/3x3a_srgb_lossless.html | 8 +++ .../tests/jpegxl/3x3a_srgb_lossy-ref.html | 4 ++ .../web-platform/tests/jpegxl/3x3a_srgb_lossy.html | 8 +++ testing/web-platform/tests/jpegxl/META.yml | 3 + .../jpegxl/resources/3x3_jpeg_recompression.jxl | Bin 0 -> 422 bytes .../jpegxl/resources/3x3_jpeg_recompression.png | Bin 0 -> 169 bytes .../tests/jpegxl/resources/3x3_srgb_lossless.jxl | Bin 0 -> 66 bytes .../tests/jpegxl/resources/3x3_srgb_lossless.png | Bin 0 -> 152 bytes .../tests/jpegxl/resources/3x3_srgb_lossy.jxl | Bin 0 -> 200 bytes .../tests/jpegxl/resources/3x3_srgb_lossy.png | Bin 0 -> 156 bytes .../tests/jpegxl/resources/3x3a_srgb_lossless.jxl | Bin 0 -> 66 bytes .../tests/jpegxl/resources/3x3a_srgb_lossless.png | Bin 0 -> 163 bytes .../tests/jpegxl/resources/3x3a_srgb_lossy.jxl | Bin 0 -> 215 bytes .../tests/jpegxl/resources/3x3a_srgb_lossy.png | Bin 0 -> 167 bytes .../tests/jpegxl/resources/generate_resources.sh | 76 +++++++++++++++++++++ 22 files changed, 139 insertions(+) create mode 100644 testing/web-platform/tests/jpegxl/3x3_jpeg_recompression-ref.html create mode 100644 testing/web-platform/tests/jpegxl/3x3_jpeg_recompression.html create mode 100644 testing/web-platform/tests/jpegxl/3x3_srgb_lossless-ref.html create mode 100644 testing/web-platform/tests/jpegxl/3x3_srgb_lossless.html create mode 100644 testing/web-platform/tests/jpegxl/3x3_srgb_lossy-ref.html create mode 100644 testing/web-platform/tests/jpegxl/3x3_srgb_lossy.html create mode 100644 testing/web-platform/tests/jpegxl/3x3a_srgb_lossless-ref.html create mode 100644 testing/web-platform/tests/jpegxl/3x3a_srgb_lossless.html create mode 100644 testing/web-platform/tests/jpegxl/3x3a_srgb_lossy-ref.html create mode 100644 testing/web-platform/tests/jpegxl/3x3a_srgb_lossy.html create mode 100644 testing/web-platform/tests/jpegxl/META.yml create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3_jpeg_recompression.jxl create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3_jpeg_recompression.png create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossless.jxl create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossless.png create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossy.jxl create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossy.png create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossless.jxl create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossless.png create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossy.jxl create mode 100644 testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossy.png create mode 100755 testing/web-platform/tests/jpegxl/resources/generate_resources.sh (limited to 'testing/web-platform/tests/jpegxl') diff --git a/testing/web-platform/tests/jpegxl/3x3_jpeg_recompression-ref.html b/testing/web-platform/tests/jpegxl/3x3_jpeg_recompression-ref.html new file mode 100644 index 0000000000..070243d6a7 --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3_jpeg_recompression-ref.html @@ -0,0 +1,4 @@ + +JPEG XL test reference + + diff --git a/testing/web-platform/tests/jpegxl/3x3_jpeg_recompression.html b/testing/web-platform/tests/jpegxl/3x3_jpeg_recompression.html new file mode 100644 index 0000000000..f28fca8fdc --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3_jpeg_recompression.html @@ -0,0 +1,8 @@ + +JPEG XL test + + + + + + diff --git a/testing/web-platform/tests/jpegxl/3x3_srgb_lossless-ref.html b/testing/web-platform/tests/jpegxl/3x3_srgb_lossless-ref.html new file mode 100644 index 0000000000..1bb5083240 --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3_srgb_lossless-ref.html @@ -0,0 +1,4 @@ + +JPEG XL test reference + + diff --git a/testing/web-platform/tests/jpegxl/3x3_srgb_lossless.html b/testing/web-platform/tests/jpegxl/3x3_srgb_lossless.html new file mode 100644 index 0000000000..589f11c68c --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3_srgb_lossless.html @@ -0,0 +1,8 @@ + +JPEG XL test + + + + + + diff --git a/testing/web-platform/tests/jpegxl/3x3_srgb_lossy-ref.html b/testing/web-platform/tests/jpegxl/3x3_srgb_lossy-ref.html new file mode 100644 index 0000000000..a5e95baba3 --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3_srgb_lossy-ref.html @@ -0,0 +1,4 @@ + +JPEG XL test reference + + diff --git a/testing/web-platform/tests/jpegxl/3x3_srgb_lossy.html b/testing/web-platform/tests/jpegxl/3x3_srgb_lossy.html new file mode 100644 index 0000000000..3a92b2b730 --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3_srgb_lossy.html @@ -0,0 +1,8 @@ + +JPEG XL test + + + + + + diff --git a/testing/web-platform/tests/jpegxl/3x3a_srgb_lossless-ref.html b/testing/web-platform/tests/jpegxl/3x3a_srgb_lossless-ref.html new file mode 100644 index 0000000000..75d8ba7452 --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3a_srgb_lossless-ref.html @@ -0,0 +1,4 @@ + +JPEG XL test reference + + diff --git a/testing/web-platform/tests/jpegxl/3x3a_srgb_lossless.html b/testing/web-platform/tests/jpegxl/3x3a_srgb_lossless.html new file mode 100644 index 0000000000..1de61a5ba2 --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3a_srgb_lossless.html @@ -0,0 +1,8 @@ + +JPEG XL test + + + + + + diff --git a/testing/web-platform/tests/jpegxl/3x3a_srgb_lossy-ref.html b/testing/web-platform/tests/jpegxl/3x3a_srgb_lossy-ref.html new file mode 100644 index 0000000000..3a1c22e8a2 --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3a_srgb_lossy-ref.html @@ -0,0 +1,4 @@ + +JPEG XL test reference + + diff --git a/testing/web-platform/tests/jpegxl/3x3a_srgb_lossy.html b/testing/web-platform/tests/jpegxl/3x3a_srgb_lossy.html new file mode 100644 index 0000000000..59583a11a9 --- /dev/null +++ b/testing/web-platform/tests/jpegxl/3x3a_srgb_lossy.html @@ -0,0 +1,8 @@ + +JPEG XL test + + + + + + diff --git a/testing/web-platform/tests/jpegxl/META.yml b/testing/web-platform/tests/jpegxl/META.yml new file mode 100644 index 0000000000..d012c7f9ba --- /dev/null +++ b/testing/web-platform/tests/jpegxl/META.yml @@ -0,0 +1,3 @@ +spec: https://jpeg.org/jpegxl/workplan.html +suggested_reviewers: + - mo271 diff --git a/testing/web-platform/tests/jpegxl/resources/3x3_jpeg_recompression.jxl b/testing/web-platform/tests/jpegxl/resources/3x3_jpeg_recompression.jxl new file mode 100644 index 0000000000..deee4257ff Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3_jpeg_recompression.jxl differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3_jpeg_recompression.png b/testing/web-platform/tests/jpegxl/resources/3x3_jpeg_recompression.png new file mode 100644 index 0000000000..b147cb57bd Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3_jpeg_recompression.png differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossless.jxl b/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossless.jxl new file mode 100644 index 0000000000..bb9cf0bb2e Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossless.jxl differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossless.png b/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossless.png new file mode 100644 index 0000000000..f314145a13 Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossless.png differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossy.jxl b/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossy.jxl new file mode 100644 index 0000000000..a2d7a898e1 Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossy.jxl differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossy.png b/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossy.png new file mode 100644 index 0000000000..ad5ef8117f Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3_srgb_lossy.png differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossless.jxl b/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossless.jxl new file mode 100644 index 0000000000..6bbb43d8e7 Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossless.jxl differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossless.png b/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossless.png new file mode 100644 index 0000000000..3c5f9c4e6b Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossless.png differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossy.jxl b/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossy.jxl new file mode 100644 index 0000000000..0a4e952e3b Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossy.jxl differ diff --git a/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossy.png b/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossy.png new file mode 100644 index 0000000000..885c5d0359 Binary files /dev/null and b/testing/web-platform/tests/jpegxl/resources/3x3a_srgb_lossy.png differ diff --git a/testing/web-platform/tests/jpegxl/resources/generate_resources.sh b/testing/web-platform/tests/jpegxl/resources/generate_resources.sh new file mode 100755 index 0000000000..359b2afd9e --- /dev/null +++ b/testing/web-platform/tests/jpegxl/resources/generate_resources.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# This generates the png and jxl images needed. + +# Function to check if a command exists +command_exists() { + command -v "$1" &> /dev/null +} + +# Function to convert and compress an image +convert_and_compress() { + local input_image=$1 + local base_name=$2 + local color_space=$3 + + cjxl "$input_image" temp.jxl -d 0 + djxl temp.jxl "${base_name}_${color_space}_lossless.png" + cjxl "${base_name}_${color_space}_lossless.png" "${base_name}_${color_space}_lossy.jxl" -d 0.0001 -e 7 + djxl "${base_name}_${color_space}_lossy.jxl" "${base_name}_${color_space}_lossy.png" + cjxl "${base_name}_${color_space}_lossless.png" "${base_name}_${color_space}_lossless.jxl" -d 0 +} + +# Check for required tools +for tool in convert cjxl djxl; do + if ! command_exists "$tool"; then + echo "$tool could not be found. Please install it and run the script again." + exit 1 + fi +done + +# Create a 3x3 transparent image +convert -size 3x3 xc:none 3x3a.png + +# Draw colors with alpha values +convert 3x3a.png \ +-fill "rgba(255,0,0,0.5)" -draw "point 0,0" \ +-fill "rgba(0,255,0,0.5)" -draw "point 1,0" \ +-fill "rgba(0,0,255,0.5)" -draw "point 2,0" \ +-fill "rgba(128,64,64,0.5)" -draw "point 0,1" \ +-fill "rgba(64,128,64,0.5)" -draw "point 1,1" \ +-fill "rgba(64,64,128,0.5)" -draw "point 2,1" \ +-fill "rgba(255,255,255,0.5)" -draw "point 0,2" \ +-fill "rgba(128,128,128,0.5)" -draw "point 1,2" \ +-fill "rgba(0,0,0,0.5)" -draw "point 2,2" \ +3x3a.png + +# Generate initial image with alpha values +generate_image 3x3a.png + +# Generate a version without alpha channel +convert 3x3a.png -alpha off 3x3.png + +# Define color spaces +# TODO(firsching): add "RGB_D65_202_Rel_PeQ" and "RGB_D65_202_Rel_HLG" as color spaces here +color_spaces=("srgb") + +# Loop through color spaces and convert/compress images +for color_space in "${color_spaces[@]}"; do + convert_and_compress 3x3.png "3x3" "$color_space" + convert_and_compress 3x3a.png "3x3a" "$color_space" +done + +convert 3x3.png -quality 70 3x3.jpg +# lossless recompression +cjxl 3x3.jpg 3x3_jpeg_recompression.jxl +# checking that it was actually byte exact +djxl 3x3_jpeg_recompression.jxl 3x3_recovered.jpg +diff 3x3.jpg 3x3_recovered.jpg +if [ $? -ne 0 ]; then + echo "The recovery of the recompressed jpg failed: 3x3.png and 3x3_recovered.jpg differ" + exit 1 +fi +# generate reference png +djxl 3x3_jpeg_recompression.jxl 3x3_jpeg_recompression.png + +# Cleanup temporary file +rm -f temp.jxl 3x3.png 3x3a.png 3x3.jpg 3x3_recovered.jpg -- cgit v1.2.3