Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Leonid_Kryvelyov
Beginner
86 Views

Colors problem after decoding jpeg lossless image by UIC applications

Hello,

I'm using w_ipp_7.0.2.154_ia32 and w_ipp-samples_p_7.0.2.048. I've found that after converting jpeg lossless image by picnic and uic_transcoder_con to .bmp colors in output are different (yellow or blue ruler on the right side of image). I thinkpicnic's outputis correct. My code mostly copied/pasted from uic_transcoder produces wrong resultcorrespondingly. Could you please point me what should be fixed in in uic_transcoder_con to get correct results?

Attachments:
jplossless.jpeg - original file
jplossless_picnic.bmp - picnic's output
jplossless_con.bmp - uic_transcoder_con's output

Regards,
Leonid
0 Kudos
4 Replies
Chao_Y_Intel
Employee
86 Views


Leonid,

could you have a check on the first attachment, jplossless.jpeg? We can not download this file here.

Thanks,
Chao
Sergey_Ryadno
New Contributor I
86 Views

Hi Leonid,
when we decoding this lossless jpeg file the color type of image is seted to IC_UNKNOWN - this means that decoder can`t determine correct color of compressed data and gives image after decoding "as is" without any color transformation. Later in Picnic application we are trying to suggest wich color is used. This suggestion is based on number of image channels and looks like:
[bash]  if(IC_UNKNOWN == image.Color())
  {
    switch(image.NChannels())
    {
    case 1: image.Color(IC_GRAY); break;
    case 3: image.Color(IC_RGB);  break;
    case 4: image.Color(IC_RGBA); break;
    default:
      break;
    }
  }[/bash]
This suggestion is needed to determine output params for displaying. And seems we are make a correct guess in this case - original image color is RGB.
But in transcoder no such suggestion (but i think must be and i`m going to add it). And image saved in RGB chanel order, but need to be converted to BGR before saving. The simplest way to resolve this issue is add such suggestion in SaveImageBMP() function just after strings:
[bash]  switch(image.NChannels())
  {
    case 1: imageCn.ColorSpec().SetEnumColorSpace(Grayscale); break;
    case 3: imageCn.ColorSpec().SetEnumColorSpace(BGR);       break;
    case 4: imageCn.ColorSpec().SetEnumColorSpace(BGRA);      break;
    default:
      break;
  }

// put this suggestion here[/bash]
Thomas_Jensen1
Beginner
86 Views

As far as I know, lossy JPEG is normally YCBCR, and lossless JPEG is normally RGB (not BGR).
The format of lossless JPEG does not have a standard, but most codecs use RGB.
Leonid_Kryvelyov
Beginner
86 Views

Thanks to all for your help. The lossless image I experimented with,sure has IC_UNKNOWN color type, I've uploaded it in .zip. It seems method MainWindow::createFrame(CIppImage& image, CIppImage& frame) in picnic performs color conversions.

Regards,
Leonid
Reply