Page 1 of 1

Quality loss with JPEG2000?

Posted: 2013-01-18T17:18:01-07:00
by syamashi
Hello,

I'm trying to look into the capabilities of JPEG2000 file format and experiencing file conversion challenges from TIF format. It seems that sometimes the converted images contain dark rectangles spotted in various parts in an image. Most of the time this happens in the very bright parts in an image. Here is the command I run:

Code: Select all

convert input.jpg -define numrlvls=7 -define jp2:tilewidth=256 -define jp2:tileheight=256 -define jp2:rate=0.02348 -define jp2:prg=rpcl -define jp2:mode=int -define jp2:prcwidth=256 -define jp2:prcheight=256 -define jp2:cblkwidth=64 -define jp2:cblkheight=64 -define jp2:sop output.jp2 
Is there a way I can get rid of these artifacts by tweaking parameters?

thanks,

Re: Quality loss with JPEG2000?

Posted: 2013-01-21T14:48:46-07:00
by Wolfgang Woehl
jp2:rate is probably too low.

Re: Quality loss with JPEG2000?

Posted: 2013-01-22T11:53:40-07:00
by syamashi
jp2:rate didn't seem to work but the example of the lossless encoding option on the ImageMagick example did work.

Code: Select all

$ convert input.tif -define numrlvls=6 -define jp2:tilewidth=1024 -define jp2:tileheight=1024 \
-define jp2:rate=1.0 -define jp2:lazy -define jp2:prg=rlcp -define jp2:ilyrrates=\
'0.015625,0.01858,0.0221,0.025,0.03125,0.03716,0.04419,0.05,0.0625, 0.075,0.088,0.1,0.125,0.15,0.18,0.21,0.25,0.3,0.35,0.4,0.5,0.6,0.7,0.84' \
-define jp2:mode=int output.jp2
http://www.imagemagick.org/script/jp2.php

However, the file comes out in around 200MB which was around 10MB with the original conversion. How and which parameters can I tweak to adjust conversion without losing too much of the quality? My goal is to limit the file size under 80MB without having those rectangular artifacts.

Re: Quality loss with JPEG2000?

Posted: 2013-01-23T18:58:36-07:00
by syamashi
Is there a way to downsize an image by adjusting "jp2:ilyrrates"? How do I come up with these rates?

Re: Quality loss with JPEG2000?

Posted: 2013-01-24T16:27:57-07:00
by syamashi
Interestingly, jp2:rate values did not affect but jp2:prg value did. I hope someone can explain what's going on..

Code: Select all

convert input.tif -define numrlvls=7 -define jp2:tilewidth=1024 -define jp2:tileheight=1024 -define jp2:rate=0.01 -define jp2:mode=int -define jp2:prcwidth=1024 -define jp2:prcheight=1024 -define jp2:cblkwidth=64 -define jp2:cblkheight=64 -define jp2:prg=rlcp ouput.jp2