daniellerch / python-jpeg-toolbox

The JPEG toolbox for Python
MIT License
13 stars 7 forks source link

Description of paramters? #2

Closed zzd1992 closed 3 years ago

zzd1992 commented 3 years ago

Thanks for your work.

When I read an image with your toolbox, it has the following keys:

'image_width', 'image_height', 'image_color_space', 'image_components', 'jpeg_color_space', 'jpeg_components', 'progressive_mode', 'comp_info', 'quant_tables', 'ac_huff_tables', 'dc_huff_tables', 'coef_arrays'

I am not sure about the meaning of them. For example, what is the meaning of 'jpeg_color_space' = 3? Can you provide their descriptions (or the reference of descriptions)?

daniellerch commented 3 years ago

These is the data contained in the JPEG file, you can find what is each field in the JPEG standard. Most of the fields have self explanatory names. For example, 'image_width' and 'image_heigh' contain the width and the height of the image, 'quant_tables' the quantization tables, 'coeff_arrays' the DCT coefficients, etc. Other fields like 'jpeg_color_space', come from libjpeg and are a little less intuitive. I have to document them. It indicates how the data is represented (1: grayscale, 3: RGB/YCbCr, 4:YCCK).