Converting Pyramidal TIFF to JPEG2000
Converting Pyramidal TIFF to JPEG2000
Hello,
I'd like to convert Pyramidal TIFF to JPEG2000. However, the generated files are separated in to seven different files which I believe they are associated with the resolution levels. The following command worked for flat TIFFs to generate a single file:
% convert source_image -define numrlvls=7 -define jp2:tilewidth=1024 -define jp2:tileheight=1024 -define jp2:rate=0.02348 -define jp2:prg=rpcl -define jp2:mode=int -define jp2:prcwidth=1024 -define jp2:prcheight=1024 -define jp2:cblkwidth=64 -define jp2:cblkheight=64 -define jp2:sop output_image
Could anyone shed light on how to tweak the parameters so that I can prevent the output to generate a single consolidated file?
Thanks for your help,
I'd like to convert Pyramidal TIFF to JPEG2000. However, the generated files are separated in to seven different files which I believe they are associated with the resolution levels. The following command worked for flat TIFFs to generate a single file:
% convert source_image -define numrlvls=7 -define jp2:tilewidth=1024 -define jp2:tileheight=1024 -define jp2:rate=0.02348 -define jp2:prg=rpcl -define jp2:mode=int -define jp2:prcwidth=1024 -define jp2:prcheight=1024 -define jp2:cblkwidth=64 -define jp2:cblkheight=64 -define jp2:sop output_image
Could anyone shed light on how to tweak the parameters so that I can prevent the output to generate a single consolidated file?
Thanks for your help,
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Converting Pyramidal TIFF to JPEG2000
Code: Select all
convert image.tiff -delete 1--1 ....
See IM Examples, Basics, Delete
http://www.imagemagick.org/Usage/basics/#delete
or
convert image.tiff"[0]" ....
See IM Examples, File Handling, Read modifiers
http://www.imagemagick.org/Usage/files/#read_mods
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Converting Pyramidal TIFF to JPEG2000
Hi anthony,
Thanks for you reply. That should work on what I intend to do. I also have two more question regarding this conversion and I hope you don't mind answering.
I'm attempting to convert a TIFF file which is 14000x11000 in size and the lowest resolution level of the JPEG2000 from previous convert command gives me "229x172" in size. However, I intend to get "106x79" for the lowest resolution level. I've tried tweaking the parameters but none of them seem to get as I expect. For example, I've tried various "numrlvls" from 6~9. Is there anyway I can tweak the parameters to get much smaller size of lowest resolution level? The other question is, does ImageMagick has a command to get basic information of the JPEG2000 file? For example, I'd like to extract how many resolution levels are there and what sizes for each level.
thanks,
syamashi
Thanks for you reply. That should work on what I intend to do. I also have two more question regarding this conversion and I hope you don't mind answering.
I'm attempting to convert a TIFF file which is 14000x11000 in size and the lowest resolution level of the JPEG2000 from previous convert command gives me "229x172" in size. However, I intend to get "106x79" for the lowest resolution level. I've tried tweaking the parameters but none of them seem to get as I expect. For example, I've tried various "numrlvls" from 6~9. Is there anyway I can tweak the parameters to get much smaller size of lowest resolution level? The other question is, does ImageMagick has a command to get basic information of the JPEG2000 file? For example, I'd like to extract how many resolution levels are there and what sizes for each level.
thanks,
syamashi
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting Pyramidal TIFF to JPEG2000
Perhaps there is some automatic padding that you will not be able to remove, or there is some virtual-canvas created that is larger than you expect. For the latter, try adding +repage before the output.
Re: Converting Pyramidal TIFF to JPEG2000
Hi,
I tried with "+repage" option but that didn't help. The lowest resolution level comes out in "229x172". Here is the command I'm running:
Is there a way to know the dimensions of each level?
thanks,
I tried with "+repage" option but that didn't help. The lowest resolution level comes out in "229x172". Here is the command I'm running:
Code: Select all
convert input.tif -define jp2:numrlvls=7 -define jp2:tilewidth=1024 -define jp2:tileheight=1024 -define jp2:rate=0.02348 -define jp2:prg=rpcl -define jp2:mode=int -define jp2:prcwidth=1024 -define jp2:prcheight=1024 -define jp2:cblkwidth=64 -define jp2:cblkheight=64 -define jp2:sop +repage output.jp2
thanks,
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting Pyramidal TIFF to JPEG2000
idenify -verbose yourimage
should tell you everything about each level
If you just want the wxh you can do
convert yourimage -format "%w x %h" info:
and it should list that information for each level
should tell you everything about each level
If you just want the wxh you can do
convert yourimage -format "%w x %h" info:
and it should list that information for each level
Re: Converting Pyramidal TIFF to JPEG2000
Interestingly, I was not able to list the dimensions with one consolidated JPEG2000 file as opposed to what listed with Pyramidal TIFF file. However, I managed to print the dimensions of individually generated files and they appeared to be the same dimensions.
thanks for your help,
thanks for your help,
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting Pyramidal TIFF to JPEG2000
syamashi wrote:Interestingly, I was not able to list the dimensions with one consolidated JPEG2000 file as opposed to what listed with Pyramidal TIFF file. However, I managed to print the dimensions of individually generated files and they appeared to be the same dimensions.
thanks for your help,
Perhaps IM does not support Pyramid structures in JP2000. It may be a limitation of the Jasper delegate library. Check the docs on Jasper and see if it does support it and report back.
Re: Converting Pyramidal TIFF to JPEG2000
Sorry, I couldn't find this.Check the docs on Jasper and see if it does support it and report back.