how to manually specify the jp2 type?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
giantjupiter
Posts: 3
Joined: 2011-05-31T21:21:26-07:00
Authentication code: 8675308

how to manually specify the jp2 type?

Post 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)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to manually specify the jp2 type?

Post by anthony »

what was the command line?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
giantjupiter
Posts: 3
Joined: 2011-05-31T21:21:26-07:00
Authentication code: 8675308

Re: how to manually specify the jp2 type?

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to manually specify the jp2 type?

Post by anthony »

Try adding -type TrueColor before the final write.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
giantjupiter
Posts: 3
Joined: 2011-05-31T21:21:26-07:00
Authentication code: 8675308

Re: how to manually specify the jp2 type?

Post by giantjupiter »

'-type TrueColor' solved my problem. Thanks. :D
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to manually specify the jp2 type?

Post by anthony »

Good to hear!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply