This project has moved and is read-only. For the latest updates, please go here.

SetDefine Options for the JP2000 encoder not works

Jan 3, 2015 at 4:53 PM
Hello,

i will convert a image file to a J2K file and will set some encoder options, but the settings not working....

i have set this settings,
        image.SetDefine(MagickFormat.J2k, "cblkwidth", "32")
        image.SetDefine(MagickFormat.J2k, "cblkheight", "32")
        image.SetDefine(MagickFormat.J2k, "prg", "CPRL")
        image.SetDefine(MagickFormat.J2k, "numrlvls", "6")
        image.SetDefine(MagickFormat.J2k, "rate", "30")
the file looks the same with and without this settings...
Jan 3, 2015 at 8:13 PM
ImageMagick uses the name of the 'coder' as the suffix for the options. In this case the coder is not J2K but JP2. So you should use MagickFormat.Jp2. I don't know where you found those options but they are not on this page: http://www.imagemagick.org/script/jp2.php. I double checked the code and those are the available options.
  • cblkwidth and cblkheight cannot be changed at the moment, they are initialized at 32 (Let me know if you need me to add an extra jp2 option to the code and I should be able to add this before the next release)
  • prg = jp2:progression-order and is initialized with 'CPRL'.
  • numrlvls = jp2:number-resolutions and has a default value of 6.
  • rate = jp2:rate.
p.s. I am planning to make the defines easier with classes per 'coder' that have defines. I don't know when I will add this but at some point you will have an Jp2Defines class that will make life easier for you.
Jan 5, 2015 at 5:54 PM
Thanks, this works...

I have found the options on this url, http://webapp5.rrz.uni-hamburg.de/RRZ/ImageMagick/www/jp2.html. I have just googled it, and not checked the url.....

i think i found another weird problem with the performance of the encoder when i run with multiple threads.... but i will check it again, if i don't find the problem i will write a new thread....