Page 1 of 1

how to manually specify the jp2 type?

Posted: 2011-05-31T21:33:56-07:00
by giantjupiter
Hi,

I have a lot of jpg images which I used "convert" to convert them to jp2 images, but one of them, which is all text, was converted automatically as grayscale, and resulted in a very blur image. The rest are fine. I run them in a batch job, so I have to use the identical parameters for all the images.

Is there a option with which I can specify the "Type"? I looked around and couldn't find any.

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

"identify" of the incorrect jp2 showed

Code: Select all

Type: Grayscale
  Base type: Grayscale
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    gray: 8-bit
  Channel statistics:
    gray:
      min: 0 (0)
      max: 255 (1)
      mean: 237.756 (0.932375)
      standard deviation: 40.227 (0.157753)
-----------------------------------------------------------------

The rest showed

Code: Select all

  Format: JP2 (JPEG-2000 File Format Syntax)
  Class: DirectClass
  Geometry: 823x1200+0+0
  Resolution: 72x72
  Print size: 11.4306x16.6667
  Units: Undefined
  Type: TrueColor
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    red:
      min: 0 (0)
      max: 255 (1)
      mean: 236.341 (0.926826)
      standard deviation: 46.7814 (0.183457)
    green:
      min: 0 (0)
      max: 255 (1)
      mean: 236.299 (0.926664)
      standard deviation: 46.8456 (0.183708)
    blue:
      min: 0 (0)
      max: 255 (1)
      mean: 236.263 (0.926521)
      standard deviation: 46.8824 (0.183852)

Re: how to manually specify the jp2 type?

Posted: 2011-05-31T22:21:45-07:00
by anthony
what was the command line?

Re: how to manually specify the jp2 type?

Posted: 2011-05-31T22:39:00-07:00
by giantjupiter
The command line used in the batch job is

Code: Select all

convert.exe -unsharp 0x1.5 -density 72x72 -resize x1200 -define jp2:rate=0.04 input.jpg output.jp2

Re: how to manually specify the jp2 type?

Posted: 2011-05-31T23:23:20-07:00
by anthony
Try adding -type TrueColor before the final write.

Re: how to manually specify the jp2 type?

Posted: 2011-06-01T00:02:43-07:00
by giantjupiter
'-type TrueColor' solved my problem. Thanks. :D

Re: how to manually specify the jp2 type?

Posted: 2011-06-01T00:26:00-07:00
by anthony
Good to hear!