Hello, this post to ask help about a problem i've encountered re-encoding bitmap images into jpegs, with any software and windows xp built'in image viewer every image is displayed fine but when i try to visualize the same images using Vista or using DirectX to decode jpeg, colors seem to be swapped (from rgb to bgr or something similar), this is strange because if you use any program different from the image viewer built'in with Vista the jpegs are showed fine, any idea, is there something i was forgetting or even i don't know? Many thanx in advance!
链接已复制
7 回复数
Hello, thank you for the answer, i use the function SaveImageJpeg taken from ipp jpegview sample, its very strange any images manipulation program(even the windows paint) opens it perfectly except using Vista with its built'in image explorer or if i try to decode it using DirectX the image shows as its bits are swapped, anyway the built jpeg seems to be fine in format.
params.color = JC_RGB;
params.huffman_opt = 0;
params.mode = JPEG_BASELINE;
params.point_transform = 0;
params.predictor = 1;
params.quality = 100;
params.restart_interval = 0;
params.sampling = JS_444;
params.dct_scale = JD_1_1;
these are my setting for the jpeg encoder.
Regards
params.color = JC_RGB;
params.huffman_opt = 0;
params.mode = JPEG_BASELINE;
params.point_transform = 0;
params.predictor = 1;
params.quality = 100;
params.restart_interval = 0;
params.sampling = JS_444;
params.dct_scale = JD_1_1;
these are my setting for the jpeg encoder.
Regards
I'm seeing exactly same problem, file written with IPP JPEG encoder shows up as BGR in Vista's Explorer. All other programs I've tested (Paint, IrfanView, ImageMagick, XnView, Mozilla Firefox) shows it as RGB.
Hello,
could you please attach piece of code you use to create JPEG file and resulting JPEG file itself? This might help us to investigate your issue. By the way, most probable reason is that you specify RGB color for internal JPEG image representation which is not general approach although allowed by JPEG specification. Our recomendation is to use YCbCr color space for internal JPEG image representation which leads to better compression.
Note, with IPP JPEG codec you specify color twice. First you need to specify your uncompressed image color space (usually RGB or BGR) and second, you need to specify color space to be used internally by JPEG codec.
Regards,
Vladimir
Vladimir
