Skip to content

comomac/learnjpeg-go

Repository files navigation

Learn JPEG in Go

Learn how JPEG works by reinventing the library. Focus will be on bare minimum amount of code and the workings of code are understandable.

Limitation (to speed up dev, learn and reduce complexity)

  • Encode only
  • Portable Pixmap Format P6 input file format only
  • Quality set to 75%, no other quality
  • No Chroma subsampling
  • Width and Height are divisible by 16
  • Only Lossy and Baseline sequential process
  • No optimisation
  • Use precomputed or provided numbers

Order

  • Convert RGB to YCbCr
  • Chroma Subsampling 4:2:0
  • Pixels block to 8x8
  • Discrete Cosine Transform (DCT II)
  • Quantization
  • Encode
    • Zigzag
    • Huffman
    • Run-length encoding
  • Store Header + Data

References

About

Learn JPEG by reinventing the library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages