Stream is a lightweight tool to stream one or more pixel components of the image or portion of the image to your choice of storage formats. It writes the pixel components as they are read from the input image a row at a time making stream desirable when working with large images or when you require raw pixel components.
We list a few examples of the stream command here to illustrate its usefulness and ease of use. To get started, lets stream the red, green, blue components of a 640x480 JPEG image to disk as unsigned characters:
magick stream -map rgb -storage-type char image.jpg pixels.dat magick display -depth 8 -size 640x480 rgb:pixels.dat
Here we extract a 100x100 region from a TIFF image in the grayscale format as doubles:
magick stream -map i -storage-type double -extract 100x100+30+40 image.tif gray.raw
You can also associate the region to extract with the image filename:
magick stream -map i -storage-type double 'image.tif[100x100+30+40]' gray.raw
Streaming requires that the image coder read the image pixels in row order. Not all formats adhere to this requirement. Verify a particular image format first, before you utilize streaming in your workflow.
The stream command recognizes these options. Click on an option to get more details about how that option works.
|decrypt image with this password
|apply option to select image channels
|set image colorspace
|display copious debugging information
|define one or more image format options
|horizontal and vertical density of the image
|extract area from image
|print program options
|type of image interlacing scheme
|pixel color interpolation method
|-limit type value
|pixel cache resource limit
|Color, Configure, Delegate, Format, Magic, Module, Resource, or Type
|format of debugging information
|store pixels in this format.
|reduce image colors in this colorspace
|suppress all warning messages
|pay attention to warning messages.
|settings remain in effect until parenthesis boundary.
|horizontal and vertical sampling factor
|seed a new sequence of pseudo-random numbers
|-set attribute value
|set an image attribute
|width and height of image
|store pixels with this storage type.
|synchronize image to storage device
|mark the image as modified
|print detailed information about the image
|print version information
|access method for pixels outside the boundaries of the image