|
4 | 4 | [](https://johnnychen94.github.io/JpegTurbo.jl/dev)
|
5 | 5 | [](https://github.com/johnnychen94/JpegTurbo.jl/actions/workflows/UnitTest.yml?query=branch%3Amaster)
|
6 | 6 | [](https://codecov.io/gh/johnnychen94/JpegTurbo.jl)
|
| 7 | + |
| 8 | +JpegTurbo.jl is a Julia wrapper of the C library [libjpeg-turbo] that provides IO support for |
| 9 | +the JPEG image format. |
| 10 | + |
| 11 | +The main functionality of this package consist of two functions: `jpeg_encode` and `jpeg_decode`. |
| 12 | +Check the [function references](https://johnnychen94.github.io/JpegTurbo.jl/dev/reference) for more |
| 13 | +details. |
| 14 | + |
| 15 | +## API |
| 16 | + |
| 17 | +`jpeg_encode` is used to compress 2D colorant matrix as JPEG image. |
| 18 | + |
| 19 | +```julia |
| 20 | +jpeg_encode(filename::AbstractString, img; kwargs...) -> Int |
| 21 | +jpeg_encode(io::IO, img; kwargs...) -> Int |
| 22 | +jpeg_encode(img; kwargs...) -> Vector{UInt8} |
| 23 | +``` |
| 24 | + |
| 25 | +`jpeg_decode` is used to decompress JPEG image as 2D colorant matrix. |
| 26 | + |
| 27 | +```julia |
| 28 | +jpeg_decode([T,] filename::AbstractString; kwargs...) -> Matrix{T} |
| 29 | +``` |
| 30 | + |
| 31 | +## Feature set |
| 32 | + |
| 33 | +| function | filename | IOStream | in-memory buffer | pre-allocated output | multi-threads | |
| 34 | +| -------------------- | -------- | -------- | -------------------- | ------------------- | ------------- | |
| 35 | +| `jpeg_encode` | x | x | x | | x | |
| 36 | +| `jpeg_decode` | x | | | | x | |
| 37 | +| `ImageMagick.save` | x | x | x | | x | |
| 38 | +| `ImageMagick.load` | x | x | x | | x | |
| 39 | +| `QuartzImageIO.save` | x | x | x (`FileIO.Stream`) | | x | |
| 40 | +| `QuartzImageIO.load` | x | x | x (`FileIO.Stream`) | | x | |
| 41 | + |
| 42 | +Notes: |
| 43 | + |
| 44 | +- `x`: supported |
| 45 | +- empty: missing/unsupported yet |
| 46 | + |
| 47 | +[libjpeg-turbo]: https://github.com/libjpeg-turbo/libjpeg-turbo |
0 commit comments