Page 1 of 1

Conversion Quality From JP2 to JPG

Posted: 2014-07-10T20:41:39-07:00
by hapiben
Hi,

We found an issue when we're downloading an image from one of our services. What we're trying to do is convert a .jp2 file to .jpg.

Using command conversion:

Code: Select all

convert img.jp2 img.jpg
Imagemagick version 6.7.7-6
Image

Upgrading Imagemagick to 6.8.9-1 will fix the issue, but I would like to know what causes the issue that I have. Does anyone here experienced the same issue?

Thanks,
Ben

Re: Conversion Quality From JP2 to JPG

Posted: 2014-07-10T20:48:23-07:00
by hapiben
More info about the image that I have. Running identify.

Code: Select all

Image: hires.jp2
  Format: JP2 (JPEG-2000 File Format Syntax)
  Class: DirectClass
  Geometry: 3200x4912+0+0
  Resolution: 72x72
  Print size: 44.4444x68.2222
  Units: Undefined
  Type: TrueColor
  Endianess: Undefined
  Colorspace: RGB
  Depth: 16-bit
  Channel depth:
    red: 16-bit
    green: 16-bit
    blue: 16-bit
  Channel statistics:
    Red:
      min: 0 (0)
      max: 65535 (1)
      mean: 35981.8 (0.549048)
      standard deviation: 7127.47 (0.108758)
      kurtosis: 0.945922
      skewness: -0.322088
    Green:
      min: 0 (0)
      max: 65535 (1)
      mean: 33058.9 (0.504446)
      standard deviation: 6901.91 (0.105316)
      kurtosis: 1.22203
      skewness: -0.137207
    Blue:
      min: 0 (0)
      max: 65535 (1)
      mean: 26976.1 (0.411629)
      standard deviation: 6923.29 (0.105643)
      kurtosis: 1.42752
      skewness: 0.0320182
  Image statistics:
    Overall:
      min: 0 (0)
      max: 65535 (1)
      mean: 32005.6 (0.488374)
      standard deviation: 6984.96 (0.106584)
      kurtosis: 2.73838
      skewness: -0.177046
  Rendering intent: Undefined
  Gamma: 1
  Interlace: None
  Background color: rgb(255,255,255)
  Border color: rgb(223,223,223)
  Matte color: rgb(189,189,189)
  Transparent color: rgb(0,0,0)
  Compose: Over
  Page geometry: 3200x4912+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG2000
  Orientation: Undefined
  Properties:
    date:create: 2014-07-11T10:16:38+12:00
    date:modify: 2014-07-11T10:03:43+12:00
    signature: 65b80d39aaa1c5d401e5c81984dece73f6835efb10c3736872c0e09919645203
  Profiles:
    Profile-icc: 544 bytes
      Description: Adobe RGB (1998)
      Manufacturer: Adobe RGB (1998)
      Model: Adobe RGB (1998)
      Copyright: (c) 2000 Adobe Systems Inc.
  Artifacts:
    filename: hires.jp2
    verbose: true
  Tainted: False
  Filesize: 19.42MB
  Number pixels: 15.72M
  Pixels per second: 2.159MB
  User time: 7.250u
  Elapsed time: 0:08.279
  Version: ImageMagick 6.7.7-6 2014-07-11 Q16 http://www.imagemagick.org

Re: Conversion Quality From JP2 to JPG

Posted: 2014-07-10T21:25:40-07:00
by fmw42
At that old release, IM was using the Jasper delegate library, which did not support the advanced features that are in JPEG 2000. The OpenJpeg used now in current releases supports most of the advance features.

See the table near the bottom of http://en.wikipedia.org/wiki/JPEG2000

Re: Conversion Quality From JP2 to JPG

Posted: 2014-07-13T14:10:17-07:00
by hapiben
Hi fmw42, thanks for the info. :-) I appreciate it. I also found at the bottom of the Wiki that jp2 on Jasper have some issues with 16-bit image conversion.