From 1865a5c438c4d9bf40370eaa58b1003fc5d9fbdf Mon Sep 17 00:00:00 2001 From: wiredfool Date: Tue, 15 Oct 2013 22:01:30 -0700 Subject: [PATCH] Shifting the midpoint of the ab channels to 128. unshifting back to signed int on pack --- Tests/images/lab-green.tif | Bin 0 -> 24380 bytes Tests/images/lab-red.tif | Bin 0 -> 24380 bytes Tests/test_format_lab.py | 41 +++++++++++++++++++++++++++++++++++++ Tests/test_image_lab.py | 25 ---------------------- libImaging/Pack.c | 15 +++++++++++++- libImaging/Unpack.c | 27 +++++++++++++++++++++++- 6 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 Tests/images/lab-green.tif create mode 100644 Tests/images/lab-red.tif create mode 100644 Tests/test_format_lab.py delete mode 100644 Tests/test_image_lab.py diff --git a/Tests/images/lab-green.tif b/Tests/images/lab-green.tif new file mode 100644 index 0000000000000000000000000000000000000000..76c129ee90812f8cb9934f5865437647f644e9dd GIT binary patch literal 24380 zcmeGkTW}lI^~&;7b{so)Af*hm5rHs_WNCNxS|KaQdJuK2M73oIohg~Mw3e4hyJB~h z*!c>S!Z#G!X{R5g(Dt*__eVR^LTUTc=?wJUPG<_GkLi>aN@@A%pq_hoS6V%6yoGd} zu+2SPc3^N+aDoktORCV`OnsBYWLSzv@~ocvw-j|a^hN67q4 zRpfPnDsIY}tZvE;D!s~51->jwxQ>`0&Bp0qoDNeA9cLo(AdM0ywiAP7f+SS7tfWsiuXj)lh}%H)f;s|08eMJg>T0u@@I{pBDVp+b=bCK`z{K_69+B`PPZQ#400 z!C;hPm^hdkVkzVDCOrTpl*&eYC6hDSgxaEaQ_~vpK;XiK3kw(61zD*EXpZ9oK_Da#LIMdT~STOYdBz+-|4QRBEJ^N;x3Z zgt{PUYJgs#18wCXo2ZoI8?sX8wWL_*t3p5%H#QQ14%TQR5x@;w3?aS53VQJGWZ)Lx zXj>?$3uGh~%5psb1h6jHZ5<%vX+_{QSt-eKExBvZB(RPy_Kt%RZIY1TH6e-P%TEXW zbhw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