I was working on a project that required using Intel's IPP libraries to convert an image in BMP to lossless JPEG2000 format (.jp2).

I went through a book on JPEG2000, and based on what I understood from there, I wrote a program to encode and put the appropriate markers. However, when I open the image in a viewer like IrfanView, I am getting a mainly gray image. The original image I used had for all pixels, R = 255, G, B = 0.

I am able to properly encode and decode the image (I wrote a decoder to test, and I can recover the BMP file). My trouble is with the boxes and markers required as per JPEG2000 standard. I think I have problems with the codestream box. In particular, I am not sure whether this part is correct:

  • I have 3 components (RGB which after RCT becomes Y0, Y1, Y2). Since I am not using tiling, and am using CPRL progression, I have 3 tiles - one for each component. I am writing the codestream obtained for subband LL first, HL next, LH after that and HH in the end. That is, the order is - LL, HL, LH, HH. I am not using packets or tile-parts. I am doing the same thing for each component.

Is what I am doing correct?

Also, I don't know if this is the right stackexchange to ask, please let me know if this is the wrong place.

closed as off-topic by Philip Kendall, Hueco, Michael C, Rafael, mattdm Jun 19 '18 at 12:39

  • This question does not appear to be about photography within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    I'm voting to close this question as off-topic because it's about creating a file rather than anything to do with a photo. – Philip Kendall Jun 19 '18 at 5:07
  • May I know which stackexchange this question would be fit for? Thanks! – Aneesh Hiregange Jun 19 '18 at 5:31
  • I'm not sure there is an appropriate SE site for this at the moment. If you could include an MCVE which demonstrates the issue, it would be appropriate for Stack Overflow. – Philip Kendall Jun 19 '18 at 6:18
  • stackoverflow.com/help/on-topic is the right place for this question – Romeo Ninov Jun 19 '18 at 9:29
  • 1
    @RomeoNinov Not at the moment it's not as it doesn't have any actual code to be fixed. It needs a Minimal, Complete, and Verifiable example or it will get closed there as well. – Philip Kendall Jun 19 '18 at 12:51

Browse other questions tagged or ask your own question.