Goal: Convert a multi-page tiff file into several png files when reading from STDIN.
Problem: When you have a file as input you can index frames e.g. using
convert "infile.tif" b%03d.tif (http://www.imagemagick.org/Usage/formats/#tiff)
but this syntax cannot be used when piping input from STDIN.
For example, I tried "tiff[0]:-" as STDIN placeholder and "png:-" as STDOUT placeholder
which does not work. I did not find documentation on the placeholder syntax.
I do not want to save it on disk if this can be avoided!
Big thanks for your ideas!
Convert multi-page tiff from STDIN pipe
Re: Convert multi-page tiff from STDIN pipe
If you want to convert a multipage TIF from stdin into separate PNGs, you should be able to use something like that:
... convert - page%3d.png (for three digits)
If you want to pick only a certain page (or a range of pages), use something like this:
... convert -[0] page0.png
Some documentation:
http://www.imagemagick.org/Usage/files/#read_mods
http://www.imagemagick.org/Usage/files/#adjoin
Works for me at least (IM v6.6.3-0, Windows).
But while testing it, I noticed some irregularities. Seems that if one writes to stdout, the pixel cache files for some formats doesn't get deleted. Example (look in your temporary directory):
convert rose: TIFF:- | identify -
And, on my system, writing a image sequence to stdout can result in a crash:
convert rose: logo: BMP:- | identify -
Can someone else reproduce it?
... convert - page%3d.png (for three digits)
If you want to pick only a certain page (or a range of pages), use something like this:
... convert -[0] page0.png
Some documentation:
http://www.imagemagick.org/Usage/files/#read_mods
http://www.imagemagick.org/Usage/files/#adjoin
Works for me at least (IM v6.6.3-0, Windows).
But while testing it, I noticed some irregularities. Seems that if one writes to stdout, the pixel cache files for some formats doesn't get deleted. Example (look in your temporary directory):
convert rose: TIFF:- | identify -
And, on my system, writing a image sequence to stdout can result in a crash:
convert rose: logo: BMP:- | identify -
Can someone else reproduce it?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert multi-page tiff from STDIN pipe
Code: Select all
But while testing it, I noticed some irregularities. Seems that if one writes to stdout, the pixel cache files for some formats doesn't get deleted. Example (look in your temporary directory):
convert rose: TIFF:- | identify -
And, on my system, writing a image sequence to stdout can result in a crash:
convert rose: logo: BMP:- | identify -
Can someone else reproduce it?
snibgo's IM pages: im.snibgo.com
Re: Convert multi-page tiff from STDIN pipe
Thanks! These issues are probably not very important, but I created a thread in the bugs forum.snibgo wrote:Confirmed on Windows 7, IM 6.6.0-8 and 6.6.3-0.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Convert multi-page tiff from STDIN pipe
such a thing should be reported as a bug. We have had reports of tmp junk being left behind, but nothing about the commands which could caused the junk tmp files.Drarakel wrote:But while testing it, I noticed some irregularities. Seems that if one writes to stdout, the pixel cache files for some formats doesn't get deleted. Example (look in your temporary directory):
convert rose: TIFF:- | identify -
And, on my system, writing a image sequence to stdout can result in a crash:
convert rose: logo: BMP:- | identify -
Can someone else reproduce it?
Code: Select all
convert rose: TIFF:- | identify -
Code: Select all
convert rose: logo: BMP:- | identify -
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Convert multi-page tiff from STDIN pipe
Thanks for testing. The replies are in the thread in the bugs forum.