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.