ImageMagick crop huge image

后端 未结 4 711
南笙
南笙 2020-12-29 17:48

I am trying to create tiles from a huge image say 40000x40000

i found a script on line for imagemagick he crops the tiles. it works fine on small images like say 100

4条回答
  •  再見小時候
    2020-12-29 18:38

    libvips has an operator that can do exactly what you want very quickly. There's a chapter in the docs introducing dzsave and explaining how it works.

    It can also do it in relatively little memory: I regularly process 200,000 x 200,000 pixel slide images using less than 1GB of memory.

    See this answer, but briefly:

    $ time convert -crop 512x512 +repage huge.tif x/image_out_%d.tif
    real    0m5.623s
    user    0m2.060s
    sys     0m2.148s
    $ time vips dzsave huge.tif x --depth one --tile-size 512 --overlap 0 --suffix .tif
    real    0m1.643s
    user    0m1.668s
    sys     0m1.000s
    

提交回复
热议问题