jonatb / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

openjpeg issues #327

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There I have two jp2 images,
("18_1805_a4_1.jp2", "18_1805_a4_2.jp2" in attach), 
can not be decompress correctly.

When running opj_decompress exe, 
"18_1805_a4_1.jp2" can get a bmp, but the color is not right, 
"18_1805_a4_2.jp2" can not get any output bmp, 

is there any problem?

the version openjpeg is v2.0.0

Original issue reported on code.google.com by xiaochua...@gmail.com on 3 Apr 2014 at 8:23

Attachments:

GoogleCodeExporter commented 9 years ago
Both images are not supported in openjpeg-2.x-trunk until now.

issue327-18_1805_a4_1.jp2:
-----------------------------
   brand(jp2 ) minv(0)
   CL[0](jp2 )
   CL[1](jpxb)
   CL[2](jpx )

   w(2000) h(3200) nc(4) bpc(7)
   signed(0) depth(8)
   compress(7) unknown_c(1) ipr(0)

   meth(1) prec(0) approx(3) enumcs(12) cs(CMYK)

CMYK is not supported until now.

issue327-18_1805_a4_2.jp2:
-----------------------------
   brand(jp2 ) minv(0)
   CL[0](jp2 )
   CL[1](jpxb)
   CL[2](jpx )

    w(300) h(400) nc(5) bpc(15)
    signed(0) depth(16)
    compress(7) unknown_c(1) ipr(0)

-------------- ICC Profile[940] ---------------
cmmtype(0x4b434d53) version(2.16.0.0) class(mntr)
color-space(RGB ) profile-connection-space(XYZ )
date(1.12.1998) time(18:58:21)
signature(acsp) platform-signature(MSFT)
profile-flags(0) [0]0 [1]0 [2:15]0
device-attr(0) white(0) negative(0) matte(0) transparent(0)
rendering-intent(0)

CIE: x(0.63190) y(1.0) z(0.54059)
[0]signature(cprt) size[72]
Copyright (c) Eastman Kodak Company, 1999, all rights reserved.
[1]signature(desc) size[131]
    DESC(ProPhoto RGBþÿProPhoto RGBProPhoto RGB)

[2]signature(wtpt) size[20]
  XYZ(0.214, 0.214, 0.214)

[3]signature(rTRC) size[14]
  curv size[1]
    curv[0]gamma(1.205)

[4]signature(gTRC) size[14]
  curv size[1]
    curv[0]gamma(1.205)

[5]signature(bTRC) size[14]
  curv size[1]
    curv[0]gamma(1.205)

[6]signature(rXYZ) size[20]
  XYZ(0.52, 0.52, 0.52)

[7]signature(gXYZ) size[20]
  XYZ(0.156, 0.156, 0.156)

[8]signature(bXYZ) size[20]
  XYZ(0.6, 0.6, 0.6)

[9]signature(dmnd) size[110]
    DESC(KODAKþÿKODAKKODAK)

[10]signature(dmdd) size[209]
    DESC('Reference Output Medium Metric(ROMM)  (þÿReference Output Medium Metric(ROMM)  'Reference Output Medium Metric(ROMM)  )

[11]signature(mmod) size[40]
   mmod
-----------------------------------------------
    meth(3) prec(2) approx(1) enumcs(0) cs(Bi-level)
------------ start cdef -------------------
[0]c(0) typ(0) asoc(1)
[1]c(1) typ(0) asoc(2)
[2]c(2) typ(0) asoc(3)
[3]c(3) typ(1) asoc(0)
[4]c(4) typ(65535) asoc(5)
------------ end cdef ---------------------

Bi-level is not supported until now.

winfried

Original comment by szukw...@arcor.de on 4 Apr 2014 at 3:31

GoogleCodeExporter commented 9 years ago
But this is interesting: with openjpeg-2.x-trunk-r2833 I get
colored images.

BMP is OK
PPM is OK
TIF is OK
TGA fails
PNG reports to have an alpha channel.
    With has_alpha == 1 the white stripes are transparent in the foreground.
    When I set has_alpha = 0 the transparency disappears.

So please try yourself.

winfried

Original comment by szukw...@arcor.de on 4 Apr 2014 at 5:05

GoogleCodeExporter commented 9 years ago
But the resulting images (BMP, etc) are slightly blurred compared
with images from kdu_expand .

winfried

Original comment by szukw...@arcor.de on 4 Apr 2014 at 6:15

GoogleCodeExporter commented 9 years ago
The attached file - from kdu_show on Win7- shows that the opj_decompress
image a4_2.png is nearly correct. Whereas the a4_1.bmp image of kdu_expand 
on LINUX is wrong: the background is dark red-brown, the puppet is blue.

Why are the opj_decompress images blurred?

winfried

Original comment by szukw...@arcor.de on 4 Apr 2014 at 12:22

Attachments:

GoogleCodeExporter commented 9 years ago
issue327-18_1805_a4_1.jp2 has an enumcs of 22: CMYK.

Adding OPJ_CLRSPC_CMYK in openjpeg.h and the function
color_cmyk_to_rgb() I got the attached image.

winfried

Original comment by szukw...@arcor.de on 7 Apr 2014 at 5:04

Attachments:

GoogleCodeExporter commented 9 years ago
Adding OPJ_CLRSPC_CMYK in openjpeg.h and the function
color_cmyk_to_rgb() I got the attached image

could you offer those addings? 

will those addings be commited in openjpeg trunk?

Original comment by xiaochua...@gmail.com on 10 Apr 2014 at 3:54

GoogleCodeExporter commented 9 years ago
CMYK (enumcs 24) can be found in part02_fcd15444-2annexm-JPX-2004.pdf.
Whereas openjpeg handles Part 1 with enumcs 16 .. 18.

So I suppose CMYK will never be part of openjpeg. Although several
issues exist with CMYK images:

issue205-test.jp2
--------------------------------
read_ihdr
    w(540) h(785) nc(4) bpc(7)
    signed(0) depth(8)
    compress(7) unknown_c(1) ipr(0)
read_colr
    meth(1) prec(2) approx(1) enumcs[12]CMYK

issue208-img0.j2k (should be: issue208-img0.jp2)
--------------------------------
read_ihdr
    w(842) h(1249) nc(4) bpc(7)
    signed(0) depth(8)
    compress(7) unknown_c(1) ipr(0)
read_colr
    meth(3) prec(3) approx(1)
    ICC-profile follows
read_colr
    meth(1) prec(4) approx(1) enumcs[12]CMYK

issue327-18_1805_a4_1.jp2
--------------------------------
read_ihdr
    w(2000) h(3200) nc(4) bpc(7)
    signed(0) depth(8)
    compress(7) unknown_c(1) ipr(0)
read_colr
    meth(1) prec(0) approx(3) enumcs[12]CMYK

data/input/nonregression/mem-b2ace68c-1381.jp2
--------------------------------
read_ihdr
    w(649) h(865) nc(1) bpc(0)
    signed(0) depth(1)
    compress(7) unknown_c(1) ipr(0)
read_colr
    meth(1) prec(2) approx(1) enumcs[12]CMYK
   nr_entries(1) nr_channels(4)

THIS IMAGE IS BROKEN BECAUSE THE PCLR BOX IS BROKEN.

--------------------------------

I you want I can send you a patch for CMYK. It would contain the
files: openjpeg.h, jp2.c, color.h, color.c, opj_decompress.c .

winfried

Original comment by szukw...@arcor.de on 10 Apr 2014 at 2:49

GoogleCodeExporter commented 9 years ago
CMYK could be part of openjpeg.
It already includes some Part-2 capabilities, like custom MCT.

Please provide the patch.

Original comment by anto...@gmail.com on 10 Apr 2014 at 3:22

GoogleCodeExporter commented 9 years ago
Here is the patch for CMYK files.

winfried

Original comment by szukw...@arcor.de on 10 Apr 2014 at 11:34

Attachments:

GoogleCodeExporter commented 9 years ago
I have forgotten to mention the test files:

test.jp2 of issue205

img0.j2k (img0.jp2) of issue208

18_1805_a4_1.jp2 of issue327

winfried

Original comment by szukw...@arcor.de on 10 Apr 2014 at 11:41

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 28 Apr 2014 at 7:52