将许多png转换为多页tiff

将许多png转换为多页tiff

问题描述:

我在StackOverflow上看过各种各样的帖子,但基本上我想做的事情就是:

I've seen various posts around StackOverflow, but basically I want to do something along the lines of:

convert *.png new.tiff

并且tiff每个png都有一个页面。所以我想要一个包含很多页面的单个tiff。这不起作用,它只转换列表中找到的第一个png。对于我正在做的事情,我实际上需要一个多页的tiff。据说imagemagick这样做。

And the tiff has a page per each png. So I want a single tiff, with many pages. This doesn't work, it only converts the first png found in the list. For what I'm doing, I actually need a multi-page tiff. Supposedly imagemagick does this.

(顺便说一句,版本是:6.8.0-10 2013-03-03 Q16)

(BTW, version is: 6.8.0-10 2013-03-03 Q16)

任何想法?

最后想出来了。您似乎必须从源代码构建才能使此功能正常工作。我使用自制软件的所有版本没有任何运气。为此,请确保删除任何旧版本,请执行以下操作:

Finally figured it out. It seems you have to build from source to get this feature working correctly. I used all versions from homebrew without any luck. To do this make sure you get rid of any old versions, so do the following:


  1. brew uninstall imagemagick

  2. brew unlink imagemagick

  3. brew install imagemagick - 来自源头的建设

  4. 可能会说你需要链接/取消链接,只需要 brew unlink imagemagick &安培;&安培; brew link imagemagick 它应该可以正常工作。

  1. brew uninstall imagemagick
  2. brew unlink imagemagick
  3. brew install imagemagick --build-from-source
  4. It might say that you need to link/unlink, just do brew unlink imagemagick && brew link imagemagick and it should work fine.

我很惊讶这里没有记录更多,特别是将多个图像转换为单个多页面的tiff。从这里你可以做 convert * .png mynewimg.tiff (如果使用globbing)如果没有你可以做 convert first.png second.png third .png mynewimg.tiff

I'm very surprised this isn't documented more, specifically converting multiple images into a single multi-paged tiff. From here you can then do convert *.png mynewimg.tiff (if using globbing) if not you can do convert first.png second.png third.png mynewimg.tiff

似乎唯一的选择是从源码构建,所以如果没有生成多页tiffs然后执行上述操作。

It seems the only option is to build from source though, so if multi-paged tiffs aren't being generated then do the above.