micro-reader-codecs 0.0.1__tar.gz → 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -412,7 +412,7 @@ checksum = "ecbdfe44b1bd960b68170b417450a628c43f7cf56bb3c5317e61cb230ee7f226"
412
412
 
413
413
  [[package]]
414
414
  name = "micro-reader-codecs"
415
- version = "0.0.1"
415
+ version = "0.0.2"
416
416
  dependencies = [
417
417
  "image-webp",
418
418
  "jpeg-decoder",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "micro-reader-codecs"
3
- version = "0.0.1"
3
+ version = "0.0.2"
4
4
  edition = "2021"
5
5
  license = "MIT"
6
6
  publish = false
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: micro-reader-codecs
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Classifier: Development Status :: 2 - Pre-Alpha
5
5
  Classifier: Intended Audience :: Science/Research
6
6
  Classifier: Programming Language :: Python :: 3
@@ -36,7 +36,7 @@ It has no Python dependencies.
36
36
 
37
37
  * Every decoder writes straight into a buffer you provide, such as a NumPy array.
38
38
  * Decoders run without holding Python's lock, so micro-reader's thread pool can decode on all cores.
39
- * JPEG 2000 and JPEG XL decode on one thread each. micro-reader already decodes many tiles at once, and threads inside the codec would compete for the same cores.
39
+ * Baseline JPEG, JPEG 2000 and JPEG XL decode on one thread each. micro-reader already decodes many tiles at once, and threads inside the codec would compete for the same cores.
40
40
 
41
41
  ## Decoders
42
42
 
@@ -44,12 +44,14 @@ It has no Python dependencies.
44
44
  | --------------------------- | ----------------------------------------- | ------------------------------------- |
45
45
  | `zstd_decompress_into` | zstd | `zstd` (libzstd) |
46
46
  | `lz4_block_decompress_into` | LZ4 block | `lz4_flex` |
47
+ | `lzf_decompress_into` | LZF (h5py's HDF5 filter) | own |
47
48
  | `lzw_decode_into` | LZW, TIFF variant | `weezl` |
48
49
  | `zlib_decompress_into` | zlib / deflate | `libdeflater` (libdeflate) |
49
50
  | `packbits_decode_into` | PackBits | own |
50
- | `jpeg_decode_into` | JPEG: baseline, progressive and lossless | `jpeg-decoder` |
51
+ | `jpeg_decode_into` | JPEG: baseline and extended (same pixels as libjpeg-turbo) | own, following libjpeg-turbo |
52
+ | | JPEG: progressive and lossless | `jpeg-decoder` |
51
53
  | `jxl_decode_into` | JPEG XL | `jxl-oxide` |
52
- | `jpeg2k_decode_into` | JPEG 2000 (J2K, JP2) | `jpeg2k` (OpenJPEG) |
54
+ | `jpeg2k_decode_into` | JPEG 2000 (J2K, JP2), also YCbCr with subsampled colour (e.g. Aperio slides) | `jpeg2k` (OpenJPEG) |
53
55
  | `png_decode_into` | PNG | `png` |
54
56
  | `webp_decode_into` | WebP, lossless and lossy | `image-webp` |
55
57
  | `unpack_bits_into` | packed samples, 1 to 32 bit | own |
@@ -86,6 +88,7 @@ The tests live in the repository's `tests/` folder:
86
88
  * `test_codecs.py`
87
89
  * `test_czi_codecs.py`
88
90
  * `test_tiff_codecs.py`
91
+ * `test_jpeg_exact.py`
89
92
  * `test_memory_limit.py`
90
93
 
91
94
  They compare these decoders with independent reference decoders, bit for bit.
@@ -94,7 +97,7 @@ They compare these decoders with independent reference decoders, bit for bit.
94
97
 
95
98
  MIT
96
99
 
97
- The bundled crates and C libraries (libzstd, libdeflate, OpenJPEG) are MIT, Apache-2.0, BSD or Zlib licensed. Their notices ship in every wheel as `THIRD_PARTY_LICENSES.txt`.
100
+ The bundled crates and C libraries (libzstd, libdeflate, OpenJPEG) are MIT, Apache-2.0, BSD or Zlib licensed. The JPEG decoder follows libjpeg-turbo (IJG and BSD licences): this software is based in part on the work of the Independent JPEG Group. All notices ship in every wheel as `THIRD_PARTY_LICENSES.txt`.
98
101
 
99
102
  Whenever `Cargo.lock` changes, regenerate it with:
100
103
 
@@ -16,7 +16,7 @@ It has no Python dependencies.
16
16
 
17
17
  * Every decoder writes straight into a buffer you provide, such as a NumPy array.
18
18
  * Decoders run without holding Python's lock, so micro-reader's thread pool can decode on all cores.
19
- * JPEG 2000 and JPEG XL decode on one thread each. micro-reader already decodes many tiles at once, and threads inside the codec would compete for the same cores.
19
+ * Baseline JPEG, JPEG 2000 and JPEG XL decode on one thread each. micro-reader already decodes many tiles at once, and threads inside the codec would compete for the same cores.
20
20
 
21
21
  ## Decoders
22
22
 
@@ -24,12 +24,14 @@ It has no Python dependencies.
24
24
  | --------------------------- | ----------------------------------------- | ------------------------------------- |
25
25
  | `zstd_decompress_into` | zstd | `zstd` (libzstd) |
26
26
  | `lz4_block_decompress_into` | LZ4 block | `lz4_flex` |
27
+ | `lzf_decompress_into` | LZF (h5py's HDF5 filter) | own |
27
28
  | `lzw_decode_into` | LZW, TIFF variant | `weezl` |
28
29
  | `zlib_decompress_into` | zlib / deflate | `libdeflater` (libdeflate) |
29
30
  | `packbits_decode_into` | PackBits | own |
30
- | `jpeg_decode_into` | JPEG: baseline, progressive and lossless | `jpeg-decoder` |
31
+ | `jpeg_decode_into` | JPEG: baseline and extended (same pixels as libjpeg-turbo) | own, following libjpeg-turbo |
32
+ | | JPEG: progressive and lossless | `jpeg-decoder` |
31
33
  | `jxl_decode_into` | JPEG XL | `jxl-oxide` |
32
- | `jpeg2k_decode_into` | JPEG 2000 (J2K, JP2) | `jpeg2k` (OpenJPEG) |
34
+ | `jpeg2k_decode_into` | JPEG 2000 (J2K, JP2), also YCbCr with subsampled colour (e.g. Aperio slides) | `jpeg2k` (OpenJPEG) |
33
35
  | `png_decode_into` | PNG | `png` |
34
36
  | `webp_decode_into` | WebP, lossless and lossy | `image-webp` |
35
37
  | `unpack_bits_into` | packed samples, 1 to 32 bit | own |
@@ -66,6 +68,7 @@ The tests live in the repository's `tests/` folder:
66
68
  * `test_codecs.py`
67
69
  * `test_czi_codecs.py`
68
70
  * `test_tiff_codecs.py`
71
+ * `test_jpeg_exact.py`
69
72
  * `test_memory_limit.py`
70
73
 
71
74
  They compare these decoders with independent reference decoders, bit for bit.
@@ -74,7 +77,7 @@ They compare these decoders with independent reference decoders, bit for bit.
74
77
 
75
78
  MIT
76
79
 
77
- The bundled crates and C libraries (libzstd, libdeflate, OpenJPEG) are MIT, Apache-2.0, BSD or Zlib licensed. Their notices ship in every wheel as `THIRD_PARTY_LICENSES.txt`.
80
+ The bundled crates and C libraries (libzstd, libdeflate, OpenJPEG) are MIT, Apache-2.0, BSD or Zlib licensed. The JPEG decoder follows libjpeg-turbo (IJG and BSD licences): this software is based in part on the work of the Independent JPEG Group. All notices ship in every wheel as `THIRD_PARTY_LICENSES.txt`.
78
81
 
79
82
  Whenever `Cargo.lock` changes, regenerate it with:
80
83
 
@@ -1,5 +1,6 @@
1
1
  Third-party software in micro-reader-codecs binary distributions
2
- (64 Rust crates, and the C libraries libzstd, libdeflate and OpenJPEG).
2
+ (64 Rust crates, the C libraries libzstd, libdeflate and OpenJPEG,
3
+ and code ported from libjpeg-turbo).
3
4
  Generated by scripts/third_party_licenses.py from Cargo.lock. Each component
4
5
  lists its licence files; their full texts follow, each distinct text once.
5
6
 
@@ -398,6 +399,11 @@ libzstd (C library compiled into the wheel by zstd-sys)
398
399
  zstd/COPYING: licence text [41]
399
400
  zstd/LICENSE: licence text [42]
400
401
 
402
+ libjpeg / libjpeg-turbo (algorithms ported into src/jpeg.rs: inverse DCT, chroma upsampling, YCbCr -> RGB)
403
+ This software is based in part on the work of the Independent JPEG Group.
404
+ licenses/libjpeg-turbo/LICENSE.md: licence text [43]
405
+ licenses/libjpeg-turbo/README.ijg: licence text [44]
406
+
401
407
  ==============================================================================
402
408
 
403
409
  LICENCE TEXTS
@@ -2931,3 +2937,408 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2931
2937
  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2932
2938
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2933
2939
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2940
+
2941
+ ==============================================================================
2942
+
2943
+ [43]
2944
+
2945
+ libjpeg-turbo Licenses
2946
+ ======================
2947
+
2948
+ libjpeg-turbo is covered by two compatible BSD-style open source licenses:
2949
+
2950
+ - The IJG (Independent JPEG Group) License, which is listed in
2951
+ [README.ijg](README.ijg)
2952
+
2953
+ This license applies to the libjpeg API library and associated programs,
2954
+ including any code inherited from libjpeg and any modifications to that
2955
+ code. Note that the libjpeg-turbo SIMD source code bears the
2956
+ [zlib License](https://opensource.org/licenses/Zlib), but in the context of
2957
+ the overall libjpeg API library, the terms of the zlib License are subsumed
2958
+ by the terms of the IJG License.
2959
+
2960
+ - The Modified (3-clause) BSD License, which is listed below
2961
+
2962
+ This license applies to the TurboJPEG API library and associated programs, as
2963
+ well as the build system. Note that the TurboJPEG API library wraps the
2964
+ libjpeg API library, so in the context of the overall TurboJPEG API library,
2965
+ both the terms of the IJG License and the terms of the Modified (3-clause)
2966
+ BSD License apply.
2967
+
2968
+
2969
+ Complying with the libjpeg-turbo Licenses
2970
+ =========================================
2971
+
2972
+ This section provides a roll-up of the libjpeg-turbo licensing terms, to the
2973
+ best of our understanding. This is not a license in and of itself. It is
2974
+ intended solely for clarification.
2975
+
2976
+ 1. If you are distributing a modified version of the libjpeg-turbo source,
2977
+ then:
2978
+
2979
+ 1. You cannot alter or remove any existing copyright or license notices
2980
+ from the source.
2981
+
2982
+ **Origin**
2983
+ - Clause 1 of the IJG License
2984
+ - Clause 1 of the Modified BSD License
2985
+ - Clauses 1 and 3 of the zlib License
2986
+
2987
+ 2. You must add your own copyright notice to the header of each source
2988
+ file you modified, so others can tell that you modified that file. (If
2989
+ there is not an existing copyright header in that file, then you can
2990
+ simply add a notice stating that you modified the file.)
2991
+
2992
+ **Origin**
2993
+ - Clause 1 of the IJG License
2994
+ - Clause 2 of the zlib License
2995
+
2996
+ 3. You must include the IJG README file, and you must not alter any of the
2997
+ copyright or license text in that file.
2998
+
2999
+ **Origin**
3000
+ - Clause 1 of the IJG License
3001
+
3002
+ 2. If you are distributing only libjpeg-turbo binaries without the source, or
3003
+ if you are distributing an application that statically links with
3004
+ libjpeg-turbo, then:
3005
+
3006
+ 1. Your product documentation must include a message stating:
3007
+
3008
+ This software is based in part on the work of the Independent JPEG
3009
+ Group.
3010
+
3011
+ **Origin**
3012
+ - Clause 2 of the IJG license
3013
+
3014
+ 2. If your binary distribution includes or uses the TurboJPEG API, then
3015
+ your product documentation must include the text of the Modified BSD
3016
+ License (see below.)
3017
+
3018
+ **Origin**
3019
+ - Clause 2 of the Modified BSD License
3020
+
3021
+ 3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
3022
+ contributors thereof in advertising, publicity, etc.
3023
+
3024
+ **Origin**
3025
+ - IJG License
3026
+ - Clause 3 of the Modified BSD License
3027
+
3028
+ 4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
3029
+ free of defects, nor do we accept any liability for undesirable
3030
+ consequences resulting from your use of the software.
3031
+
3032
+ **Origin**
3033
+ - IJG License
3034
+ - Modified BSD License
3035
+ - zlib License
3036
+
3037
+
3038
+ The Modified (3-clause) BSD License
3039
+ ===================================
3040
+
3041
+ Copyright (C) 2009-2026 D. R. Commander. All Rights Reserved.<br>
3042
+ Copyright (C) 2015 Viktor Szathmáry. All Rights Reserved.
3043
+
3044
+ Redistribution and use in source and binary forms, with or without
3045
+ modification, are permitted provided that the following conditions are met:
3046
+
3047
+ - Redistributions of source code must retain the above copyright notice,
3048
+ this list of conditions and the following disclaimer.
3049
+ - Redistributions in binary form must reproduce the above copyright notice,
3050
+ this list of conditions and the following disclaimer in the documentation
3051
+ and/or other materials provided with the distribution.
3052
+ - Neither the name of the libjpeg-turbo Project nor the names of its
3053
+ contributors may be used to endorse or promote products derived from this
3054
+ software without specific prior written permission.
3055
+
3056
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
3057
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3058
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3059
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
3060
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3061
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3062
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3063
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3064
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3065
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3066
+ POSSIBILITY OF SUCH DAMAGE.
3067
+
3068
+
3069
+ Why Two Licenses?
3070
+ =================
3071
+
3072
+ The zlib License could have been used instead of the Modified (3-clause) BSD
3073
+ License, and since the IJG License effectively subsumes the distribution
3074
+ conditions of the zlib License, this would have effectively placed
3075
+ libjpeg-turbo binary distributions under the IJG License. However, the IJG
3076
+ License specifically refers to the Independent JPEG Group and does not extend
3077
+ attribution and endorsement protections to other entities. Thus, it was
3078
+ desirable to choose a license that granted us the same protections for new code
3079
+ that were granted to the IJG for code derived from their software.
3080
+
3081
+ ==============================================================================
3082
+
3083
+ [44]
3084
+
3085
+ libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
3086
+ to include only information relevant to libjpeg-turbo, to wordsmith certain
3087
+ sections, and to remove impolitic language that existed in the libjpeg v8
3088
+ README. It is included only for reference. Please see README.md for
3089
+ information specific to libjpeg-turbo.
3090
+
3091
+
3092
+ The Independent JPEG Group's JPEG software
3093
+ ==========================================
3094
+
3095
+ This distribution contains a release of the Independent JPEG Group's free JPEG
3096
+ software. You are welcome to redistribute this software and to use it for any
3097
+ purpose, subject to the conditions under LEGAL ISSUES, below.
3098
+
3099
+ This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
3100
+ Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
3101
+ Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
3102
+ and other members of the Independent JPEG Group.
3103
+
3104
+ IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
3105
+ (also known as JPEG, together with ITU-T SG16).
3106
+
3107
+
3108
+ DOCUMENTATION ROADMAP
3109
+ =====================
3110
+
3111
+ This file contains the following sections:
3112
+
3113
+ OVERVIEW General description of JPEG and the IJG software.
3114
+ LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
3115
+ REFERENCES Where to learn more about JPEG.
3116
+ ARCHIVE LOCATIONS Where to find newer versions of this software.
3117
+ FILE FORMAT WARS Software *not* to get.
3118
+ TO DO Plans for future IJG releases.
3119
+
3120
+ Other documentation files in the distribution are:
3121
+
3122
+ User documentation:
3123
+ doc/usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
3124
+ rdjpgcom, and wrjpgcom.
3125
+ doc/*.1 Unix-style man pages for programs (same info as
3126
+ usage.txt).
3127
+ doc/wizard.txt Advanced usage instructions for JPEG wizards only.
3128
+ doc/change.log Version-to-version change highlights.
3129
+ Programmer and internal documentation:
3130
+ doc/libjpeg.txt How to use the JPEG library in your own programs.
3131
+ src/example.c Sample code for calling the JPEG library.
3132
+ doc/structure.txt Overview of the JPEG library's internal structure.
3133
+ doc/coderules.txt Coding style rules --- please read if you contribute
3134
+ code.
3135
+
3136
+ Please read at least usage.txt. Some information can also be found in the JPEG
3137
+ FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
3138
+ out where to obtain the FAQ article.
3139
+
3140
+ If you want to understand how the JPEG code works, we suggest reading one or
3141
+ more of the REFERENCES, then looking at the documentation files (in roughly
3142
+ the order listed) before diving into the code.
3143
+
3144
+
3145
+ OVERVIEW
3146
+ ========
3147
+
3148
+ This package contains C software to implement JPEG image encoding, decoding,
3149
+ and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
3150
+ method for full-color and grayscale images. JPEG's strong suit is compressing
3151
+ photographic images or other types of images that have smooth color and
3152
+ brightness transitions between neighboring pixels. Images with sharp lines or
3153
+ other abrupt features may not compress well with JPEG, and a higher JPEG
3154
+ quality may have to be used to avoid visible compression artifacts with such
3155
+ images.
3156
+
3157
+ JPEG is normally lossy, meaning that the output pixels are not necessarily
3158
+ identical to the input pixels. However, on photographic content and other
3159
+ "smooth" images, very good compression ratios can be obtained with no visible
3160
+ compression artifacts, and extremely high compression ratios are possible if
3161
+ you are willing to sacrifice image quality (by reducing the "quality" setting
3162
+ in the compressor.)
3163
+
3164
+ This software implements JPEG baseline, extended-sequential, progressive, and
3165
+ lossless compression processes. Provision is made for supporting all variants
3166
+ of these processes, although some uncommon parameter settings aren't
3167
+ implemented yet. We have made no provision for supporting the hierarchical
3168
+ processes defined in the standard.
3169
+
3170
+ We provide a set of library routines for reading and writing JPEG image files,
3171
+ plus two sample applications "cjpeg" and "djpeg", which use the library to
3172
+ perform conversion between JPEG and some other popular image file formats.
3173
+ The library is intended to be reused in other applications.
3174
+
3175
+ In order to support file conversion and viewing software, we have included
3176
+ considerable functionality beyond the bare JPEG coding/decoding capability;
3177
+ for example, the color quantization modules are not strictly part of JPEG
3178
+ decoding, but they are essential for output to colormapped file formats. These
3179
+ extra functions can be compiled out of the library if not required for a
3180
+ particular application.
3181
+
3182
+ We have also included "jpegtran", a utility for lossless transcoding between
3183
+ different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
3184
+ applications for inserting and extracting textual comments in JFIF files.
3185
+
3186
+ The emphasis in designing this software has been on achieving portability and
3187
+ flexibility, while also making it fast enough to be useful. In particular,
3188
+ the software is not intended to be read as a tutorial on JPEG. (See the
3189
+ REFERENCES section for introductory material.) Rather, it is intended to
3190
+ be reliable, portable, industrial-strength code. We do not claim to have
3191
+ achieved that goal in every aspect of the software, but we strive for it.
3192
+
3193
+ We welcome the use of this software as a component of commercial products.
3194
+ No royalty is required, but we do ask for an acknowledgement in product
3195
+ documentation, as described under LEGAL ISSUES.
3196
+
3197
+
3198
+ LEGAL ISSUES
3199
+ ============
3200
+
3201
+ In plain English:
3202
+
3203
+ 1. We don't promise that this software works. (But if you find any bugs,
3204
+ please let us know!)
3205
+ 2. You can use this software for whatever you want. You don't have to pay us.
3206
+ 3. You may not pretend that you wrote this software. If you use it in a
3207
+ program, you must acknowledge somewhere in your documentation that
3208
+ you've used the IJG code.
3209
+
3210
+ In legalese:
3211
+
3212
+ The authors make NO WARRANTY or representation, either express or implied,
3213
+ with respect to this software, its quality, accuracy, merchantability, or
3214
+ fitness for a particular purpose. This software is provided "AS IS", and you,
3215
+ its user, assume the entire risk as to its quality and accuracy.
3216
+
3217
+ This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
3218
+ All Rights Reserved except as specified below.
3219
+
3220
+ Permission is hereby granted to use, copy, modify, and distribute this
3221
+ software (or portions thereof) for any purpose, without fee, subject to these
3222
+ conditions:
3223
+ (1) If any part of the source code for this software is distributed, then this
3224
+ README file must be included, with this copyright and no-warranty notice
3225
+ unaltered; and any additions, deletions, or changes to the original files
3226
+ must be clearly indicated in accompanying documentation.
3227
+ (2) If only executable code is distributed, then the accompanying
3228
+ documentation must state that "this software is based in part on the work of
3229
+ the Independent JPEG Group".
3230
+ (3) Permission for use of this software is granted only if the user accepts
3231
+ full responsibility for any undesirable consequences; the authors accept
3232
+ NO LIABILITY for damages of any kind.
3233
+
3234
+ These conditions apply to any software derived from or based on the IJG code,
3235
+ not just to the unmodified library. If you use our work, you ought to
3236
+ acknowledge us.
3237
+
3238
+ Permission is NOT granted for the use of any IJG author's name or company name
3239
+ in advertising or publicity relating to this software or products derived from
3240
+ it. This software may be referred to only as "the Independent JPEG Group's
3241
+ software".
3242
+
3243
+ We specifically permit and encourage the use of this software as the basis of
3244
+ commercial products, provided that all warranty or liability claims are
3245
+ assumed by the product vendor.
3246
+
3247
+
3248
+ REFERENCES
3249
+ ==========
3250
+
3251
+ We recommend reading one or more of these references before trying to
3252
+ understand the innards of the JPEG software.
3253
+
3254
+ The best short technical introduction to the JPEG compression algorithm is
3255
+ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
3256
+ Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
3257
+ (Adjacent articles in that issue discuss MPEG motion picture compression,
3258
+ applications of JPEG, and related topics.) If you don't have the CACM issue
3259
+ handy, a PDF file containing a revised version of Wallace's article is
3260
+ available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
3261
+ a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
3262
+ omits the sample images that appeared in CACM, but it includes corrections
3263
+ and some added material. Note: the Wallace article is copyright ACM and IEEE,
3264
+ and it may not be used for commercial purposes.
3265
+
3266
+ A somewhat less technical, more leisurely introduction to JPEG can be found in
3267
+ "The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
3268
+ M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
3269
+ good explanations and example C code for a multitude of compression methods
3270
+ including JPEG. It is an excellent source if you are comfortable reading C
3271
+ code but don't know much about data compression in general. The book's JPEG
3272
+ sample code is far from industrial-strength, but when you are ready to look
3273
+ at a full implementation, you've got one here...
3274
+
3275
+ The best currently available description of JPEG is the textbook "JPEG Still
3276
+ Image Data Compression Standard" by William B. Pennebaker and Joan L.
3277
+ Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
3278
+ Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
3279
+ standards (DIS 10918-1 and draft DIS 10918-2).
3280
+
3281
+ The original JPEG standard is divided into two parts, Part 1 being the actual
3282
+ specification, while Part 2 covers compliance testing methods. Part 1 is
3283
+ titled "Digital Compression and Coding of Continuous-tone Still Images,
3284
+ Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
3285
+ 10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
3286
+ Continuous-tone Still Images, Part 2: Compliance testing" and has document
3287
+ numbers ISO/IEC IS 10918-2, ITU-T T.83.
3288
+
3289
+ The JPEG standard does not specify all details of an interchangeable file
3290
+ format. For the omitted details, we follow the "JFIF" conventions, revision
3291
+ 1.02. JFIF version 1 has been adopted as ISO/IEC 10918-5 (05/2013) and
3292
+ Recommendation ITU-T T.871 (05/2011): Information technology - Digital
3293
+ compression and coding of continuous-tone still images: JPEG File Interchange
3294
+ Format (JFIF). It is available as a free download in PDF file format from
3295
+ https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
3296
+ A PDF file of the older JFIF 1.02 specification is available at
3297
+ http://www.w3.org/Graphics/JPEG/jfif3.pdf.
3298
+
3299
+ The TIFF 6.0 file format specification can be obtained from
3300
+ http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation
3301
+ scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious
3302
+ problems. IJG does not recommend use of the TIFF 6.0 design (TIFF Compression
3303
+ tag 6). Instead, we recommend the JPEG design proposed by TIFF Technical Note
3304
+ #2 (Compression tag 7). Copies of this Note can be obtained from
3305
+ http://www.ijg.org/files/. It is expected that the next revision
3306
+ of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
3307
+ Although IJG's own code does not support TIFF/JPEG, the free libtiff library
3308
+ uses our library to implement TIFF/JPEG per the Note.
3309
+
3310
+
3311
+ ARCHIVE LOCATIONS
3312
+ =================
3313
+
3314
+ The "official" archive site for this software is www.ijg.org.
3315
+ The most recent released version can always be found there in
3316
+ directory "files".
3317
+
3318
+ The JPEG FAQ (Frequently Asked Questions) article is a source of some
3319
+ general information about JPEG. It is available at
3320
+ http://www.faqs.org/faqs/jpeg-faq.
3321
+
3322
+
3323
+ FILE FORMAT COMPATIBILITY
3324
+ =========================
3325
+
3326
+ This software implements ITU T.81 | ISO/IEC 10918 with some extensions from
3327
+ ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES).
3328
+ Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or
3329
+ a subset thereof, but there are other formats containing the name "JPEG" that
3330
+ are incompatible with the original JPEG standard or with JFIF (for instance,
3331
+ JPEG 2000 and JPEG XR). This software therefore does not support these
3332
+ formats. Indeed, one of the original reasons for developing this free software
3333
+ was to help force convergence on a common, interoperable format standard for
3334
+ JPEG files.
3335
+
3336
+ JFIF is a minimal or "low end" representation. TIFF/JPEG (TIFF revision 6.0 as
3337
+ modified by TIFF Technical Note #2) can be used for "high end" applications
3338
+ that need to record a lot of additional data about an image.
3339
+
3340
+
3341
+ TO DO
3342
+ =====
3343
+
3344
+ Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
@@ -0,0 +1,135 @@
1
+ libjpeg-turbo Licenses
2
+ ======================
3
+
4
+ libjpeg-turbo is covered by two compatible BSD-style open source licenses:
5
+
6
+ - The IJG (Independent JPEG Group) License, which is listed in
7
+ [README.ijg](README.ijg)
8
+
9
+ This license applies to the libjpeg API library and associated programs,
10
+ including any code inherited from libjpeg and any modifications to that
11
+ code. Note that the libjpeg-turbo SIMD source code bears the
12
+ [zlib License](https://opensource.org/licenses/Zlib), but in the context of
13
+ the overall libjpeg API library, the terms of the zlib License are subsumed
14
+ by the terms of the IJG License.
15
+
16
+ - The Modified (3-clause) BSD License, which is listed below
17
+
18
+ This license applies to the TurboJPEG API library and associated programs, as
19
+ well as the build system. Note that the TurboJPEG API library wraps the
20
+ libjpeg API library, so in the context of the overall TurboJPEG API library,
21
+ both the terms of the IJG License and the terms of the Modified (3-clause)
22
+ BSD License apply.
23
+
24
+
25
+ Complying with the libjpeg-turbo Licenses
26
+ =========================================
27
+
28
+ This section provides a roll-up of the libjpeg-turbo licensing terms, to the
29
+ best of our understanding. This is not a license in and of itself. It is
30
+ intended solely for clarification.
31
+
32
+ 1. If you are distributing a modified version of the libjpeg-turbo source,
33
+ then:
34
+
35
+ 1. You cannot alter or remove any existing copyright or license notices
36
+ from the source.
37
+
38
+ **Origin**
39
+ - Clause 1 of the IJG License
40
+ - Clause 1 of the Modified BSD License
41
+ - Clauses 1 and 3 of the zlib License
42
+
43
+ 2. You must add your own copyright notice to the header of each source
44
+ file you modified, so others can tell that you modified that file. (If
45
+ there is not an existing copyright header in that file, then you can
46
+ simply add a notice stating that you modified the file.)
47
+
48
+ **Origin**
49
+ - Clause 1 of the IJG License
50
+ - Clause 2 of the zlib License
51
+
52
+ 3. You must include the IJG README file, and you must not alter any of the
53
+ copyright or license text in that file.
54
+
55
+ **Origin**
56
+ - Clause 1 of the IJG License
57
+
58
+ 2. If you are distributing only libjpeg-turbo binaries without the source, or
59
+ if you are distributing an application that statically links with
60
+ libjpeg-turbo, then:
61
+
62
+ 1. Your product documentation must include a message stating:
63
+
64
+ This software is based in part on the work of the Independent JPEG
65
+ Group.
66
+
67
+ **Origin**
68
+ - Clause 2 of the IJG license
69
+
70
+ 2. If your binary distribution includes or uses the TurboJPEG API, then
71
+ your product documentation must include the text of the Modified BSD
72
+ License (see below.)
73
+
74
+ **Origin**
75
+ - Clause 2 of the Modified BSD License
76
+
77
+ 3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
78
+ contributors thereof in advertising, publicity, etc.
79
+
80
+ **Origin**
81
+ - IJG License
82
+ - Clause 3 of the Modified BSD License
83
+
84
+ 4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
85
+ free of defects, nor do we accept any liability for undesirable
86
+ consequences resulting from your use of the software.
87
+
88
+ **Origin**
89
+ - IJG License
90
+ - Modified BSD License
91
+ - zlib License
92
+
93
+
94
+ The Modified (3-clause) BSD License
95
+ ===================================
96
+
97
+ Copyright (C) 2009-2026 D. R. Commander. All Rights Reserved.<br>
98
+ Copyright (C) 2015 Viktor Szathmáry. All Rights Reserved.
99
+
100
+ Redistribution and use in source and binary forms, with or without
101
+ modification, are permitted provided that the following conditions are met:
102
+
103
+ - Redistributions of source code must retain the above copyright notice,
104
+ this list of conditions and the following disclaimer.
105
+ - Redistributions in binary form must reproduce the above copyright notice,
106
+ this list of conditions and the following disclaimer in the documentation
107
+ and/or other materials provided with the distribution.
108
+ - Neither the name of the libjpeg-turbo Project nor the names of its
109
+ contributors may be used to endorse or promote products derived from this
110
+ software without specific prior written permission.
111
+
112
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
113
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
114
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
115
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
116
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
117
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
118
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
119
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
120
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
121
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
122
+ POSSIBILITY OF SUCH DAMAGE.
123
+
124
+
125
+ Why Two Licenses?
126
+ =================
127
+
128
+ The zlib License could have been used instead of the Modified (3-clause) BSD
129
+ License, and since the IJG License effectively subsumes the distribution
130
+ conditions of the zlib License, this would have effectively placed
131
+ libjpeg-turbo binary distributions under the IJG License. However, the IJG
132
+ License specifically refers to the Independent JPEG Group and does not extend
133
+ attribution and endorsement protections to other entities. Thus, it was
134
+ desirable to choose a license that granted us the same protections for new code
135
+ that were granted to the IJG for code derived from their software.