Process images to stdout immediately after they are read from stdin

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
barabanus
Posts: 10
Joined: 2018-11-21T07:58:29-07:00
Authentication code: 1152

Re: Process images to stdout immediately after they are read from stdin

Post by barabanus »

magick wrote:
2020-03-18T16:46:02-07:00
Your use case cannot be supported. Many image types permit multiple frames per image file (e.g. MIFF). For these coders, stdin is read indefinitely until an EOF is detected or an exception is thrown.
I don't understand why multiple frames can't be processed immediately frame by frame if their processing command (like `-resize 50%`) assumes independent processing? Is this an overall architecture limitation that ImageMagick has no internal mechanics to recognize independent processing? In this case, why not ask for this feature because I see no logical problem to implement this functionality.

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: Process images to stdout immediately after they are read from stdin

Post by magick »

ImageMagick is a robust image processing package that handles a plethora of image formats and tasks. See https://imagemagick.org/script/architecture.php for details. In consideration of handling a wide variety of requirements, compromises have been made and as such we do not support all use cases-- e.g. your use case and cannot unless we wrote a special purpose utility to do so. The closest solution in ImageMagick for your use case is the stream utility. Take a look. It may do what you need. Note, we have not tested your use case but it was designed for streaming-- which appears to be what you want.

barabanus
Posts: 10
Joined: 2018-11-21T07:58:29-07:00
Authentication code: 1152

Re: Process images to stdout immediately after they are read from stdin

Post by barabanus »

Ok and thank you for your help. I hope this thread will help someone who tries to do similar thing.

Locked