概要

IIIFの画像配信に向けたピラミッドTIFFの作成において、ImageMagickがうまく動作しないケースがあり、調査してみました。

参考

以下のようなページで、変換方法が説明されています。

https://samvera.github.io/serverless-iiif/docs/source-images#creating-tiled-tiffs

Using the VIPS command line

#v#viiFpFp&&osos&&rrtevraiaximftp3fsrst-soaecauctmhvrtipaec_f_nebfinsasmeoinaalumdvgraeescgs.oeeotvu_ueriwrmcmicpeate_gh_iieimm.amaatnaggigeefae.l.voptuhiotafuptuctptheu_amtinp_mn_iaeimglmaeag.gete.i.tfvif0-t-i-tlniel3e-\p-ypryarmaimdid-c-ocmopmrpersessisoinonjpjepgeg-t-itliel-ew-iwditdhth252656-t-itliel-eh-ehiegihgtht252656\

Using ImageMagick

con---'vddcpeeeotrffmitiipfnnr:seeeoosuuttstriipcffjueffpt_::e_itggimiemaln\ageege-re.ga.tettioeifm-fep'-tyarrlyap=mh2ia5d6sox=f2tf5r6ue

対象データ

以下の画像を使用させていただきます。

『和泉国絵図』,写. 国立国会図書館デジタルコレクション https://dl.ndl.go.jp/pid/1286201 (参照 2025-03-11)

https://dl.ndl.go.jp/api/iiif/1286201/R0000001/full/full/0/default.jpg

wget-Oinput.jpghttps://dl.ndl.go.jp/api/iiif/1286201/R0000001/full/full/0/default.jpg

VIPS command line

変換します。

vipstiffsaveinput.jpgoutput_vips.tif-tile-pyramid-compressionjpeg-tile-width256-tile-height256

そして、以下で結果を確認します。

t=T=T=T=T=T=T=Ti=I=I=I=I=I=I=If=FITRBSCPOSPJ=FSITRBCPOSPJ=FSITRBCPOSPJ=FSITRBCPOSPJ=FSITRBCPOSPJ=FSITRBCPOSPJ=FSITRBCPOSPJfFmieiaohralPFumieiohralPFumieiohralPFumieiohralPFumieiohralPFumieiohralPFumieiohralPiTalstmmoimaETbalstmoimaETbalstmoimaETbalstmoimaETbalstmoimaETbalstmoimaETbalstmoimaEnIDgeospptepnGIDfgeosptepnGIDfgeosptepnGIDfgeosptepnGIDfgeosptepnGIDfgeosptepnGIDfgeosptepnGfFiel/lronlaFiiel/ronlaFiiel/ronlaFiiel/ronlaFiiel/ronlaFiiel/ronlaFiiel/ronlaoFrWuSeemterTFrlWuSemterTFrlWuSemterTFrlWuSemterTFrlWuSemterTFrlWuSemterTFrlWuSemterTeWitaseasaeeWitaseasaeeWitaseasaeeWitaseasaeeWitaseasaeeWitaseasaeeWitaseasaodcidimFstt/Cbdcidimstt/Cbdcidimstt/Cbdcidimstt/Cbdcidimstt/Cbdcidimstt/Cbdcidimstt/CbuitdtopoiriPolitTdtopiriPolitTdtopiriPolitTdtopiriPolitTdtopiriPolitTdtopiriPolitTdtopiriPoltrothnlroioineroythnloioineroythnloioineroythnloioineroythnloioineroythnloioineroythnloioineperh::emncnxfserph::encnxfserph::encnxfserph::encnxfserph::encnxfserph::encnxfserph::encnxfsucy::a:ei:cye:::ei:cye:::ei:cye:::ei:cye:::ei:cye:::ei:cye:::ei:tt27tSIlgt:27SIlgt:27SIlgt:27SIlgt:27SIlgt:27SIlgt:27SIlg_oa1528:cnr:u(oa6528cnr:u(oa3528cnr:u(oa1528cnr:u(oa8528cnr:u(oa4528cnr:u(oa2528cnr:u(vrt36,htor5rtr66,htor5rtr36,htor5rtr66,htor5rtr36,htor5rtr16,htor5rtr06,htor5iy3ueew3a7ye5eew3a7ye2eew3a7ye6eew3a7ye1eew3a7ye5eew3a7ye7eew3a7po0T7nmrt4od0T7mrt4od5T7mrt4od2T7mrt4odT7mrt4odT7mrt4odT7mrt4s0f0i2sep0i1fui2ep0i2fui2ep0i3fui2ep0i4fuIi2ep0i5fuIi2ep0i6fuIi2ep0i.fli:robfcIl:robfcIl:robfcIl:robfcml:robfcml:robfcml:robt=sIepgetny=semepetny=semepetny=semepetny=seaepetny=seaepetny=seaepetnyi=eminJto:t=edaiJto:t=edaiJto:t=edaiJto:t=edgiJto:t=edgiJto:t=edgiJto:tf=taLxePape=t-gLxPape=t-gLxPape=t-gLxPape=t-eLxPape=t-eLxPape=t-eLxPapegeedEt,ssreeeEt,ssreeeEt,ssreeeEt,ssreeEt,ssreeEt,ssreeEt,ss0enlGii)0enlGii)0enlGii)0enlGii)0eLnlGii)0eLnlGii)0eLnlGii)xgsiocnxsLgsocnxsLgsocnxsLgsocnxsegsocnxsegsocnxsegsocn9Lt/nnogcoet/nogdoet/nogdoet/nogdont/nogdont/nogdont/nog6ehit:ll8lnhi:ll7lnhi:llblnhi:llclghi:llclghi:llclghi:ll2n:needug:ne4ug:ne5ug:ne7ut:necut:neeut:ne9gcgY04ttcY07ttcY02ttcY02thcY0athcY06thcY00t2heCi6ih2hCi1ih2hCi2ih2hCici:2hCi7i:2hCi2i:2hCi8h5rblm8o:5blm0o:5blm8o:5blm4o5blm6o5blmao5blm:6Chan6Chan6Chan6Chan66Chan36Chan16Cha(rsg(5rsg(2rsg(1rsg(5rsg(2rsg(6rsg91e1i2e1i6e1i3e1i0e1i5e1i2e803m04m04m04m4m4m44p1a0p1a0p3a0p4ap4ap4ap00l6gl0gl7gl4gl6gl7gl90a1ea8ea3ea7ea9ea6ea0n5n4n4n3n7n8n4e7(e3(e1(e0(e5(e4(e)612161010121))))))======000000xxxxxx111111))))))

複数の TIFF ディレクトリ(レイヤー)が存在し、ピラミッドTIFF(多重解像度TIFF) として適切に作成されているようにみえます。

ImageMagick

変換します。

con---'vddcpeeeotrffmitiipfnnr:ieeeonsupttstuiiptffju.ffptj::e_ptggcgieoln\n-eea-relgarpetthoe.am-tepiotyffrr'fya=m\2i5d6sx=2t5r6ue

そして、以下で結果を確認します。

t=Ti=If=FITBCPFOSPPWPJfFmiiohiralahrPiTaltmolimagiiEnIDgesptlepnetmGfFie/roOnlaeaoFrWSemrterNrTeWiasedasuPyaodcidmstet/CmoCbuitdtpirriPobihltrothloi:oinenreperh:encnxfrtosucy::m:ei::m:tt2SIslga_oa158cnbr:u00t(crt36ht-or-.i2oy3eetw3a13c8no0Tmrot1i9v0f0iep-0i2tefl:rlo7ibr=sIeestn-eyt=emJtbo:0st.=taLPap.:etgeEt,s3si0enGii20)fxgocn9.1Ltnog69eh:ll48n:e09gR00ft2Gi04h5Blm06:6ha,csg0(1oe.20l364op370rl070a09n04e06,20).300000,0.600000,0.150000,0.060000

TIFF directory 0 のみが存在し、ピラミッドTIFF(多重解像度TIFF) になっていない可能性が高そうです。

まとめ

ImageMagickのバージョンによって結果が変わりそうですが、確かにピラミッドTIFFを作成できないケースが確認できました。

具体的な原因まで確認できていませんが、VIPSなどの使用を検討する必要がありそうです。

中途半端な情報ですが、参考になりましたら幸いです。