Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6706 Discussions

DirectX, Vista image viewer bad jpeg image color

p3pp81
Beginner
503 Views
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!

0 Kudos
7 Replies
Vladimir_Dudnik
Employee
503 Views

Hello,

what software did you use to encode bitmaps to JPEG? We see no problem with using any image encoding tools, including IPP JPEGView sample

Regards,
Vladimir

0 Kudos
p3pp81
Beginner
503 Views
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
0 Kudos
Vladimir_Dudnik
Employee
503 Views

Well, then most probably your bitmap are in BGR color, so you need to specify JC_BGR to IPP JPEG encoder.

Regards,
Vladimir

0 Kudos
p3pp81
Beginner
503 Views
Uhmm, why programs like paint or gimp and many others open it perfectly? That's really strange, i'll try that, anyway i'm sure my bitmap is rgb and not bgr.
Regards

0 Kudos
Vladimir_Dudnik
Employee
503 Views

Ok. Do you see the same issue with original IPP JPEGView sample? You can open BMP file and store it as JPEG with this program.

Vladimir

0 Kudos
jamse101
Beginner
503 Views

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.

0 Kudos
Vladimir_Dudnik
Employee
503 Views
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
0 Kudos
Reply