Programmatic Image Embedding
Using the new command Embed in the ImageTools package, you can programmatically embed images directly into your current document. The Embed command provides the functionality to insert single images or tables of images, which is useful when you are creating or manipulating an image programmatically before you want to display it. Now the image can be created or modified and then displayed in the same code, without having to save them in a separate file.
The ImageTools package works with 2-D and 3-D datatype=float[8] Arrays. Such arrays can be imported from files with the Read command, and can be created or manipulated using commands from the ImageTools package.
Similar to how you can remove plots, you can remove any such embedded image or table of images by using the menu action Edit > Remove Output.
For additional details, including descriptions of the command options, see the Embed help page.
restart:
with(ImageTools):
Example
In this example, a 3-layer color image of the Julia set is created as an Array and then embedded.
img := Fractals:-EscapeTime:-Julia( 400, -1.6-1.0*I, 1.6+1.0*I, -0.84-0.23*I );
Embed( img );
In the next example, a table is embedded, with each cell containing an image.
U1:=Read(cat(kernelopts(datadir),"/images/scissorlift.jpg")): U2:=Read(cat(kernelopts(datadir),"/images/antennas.jpg")):
Embed([[U2,Complement(U2)],[ToGrayscale(U1),U1]]);
Download Help Document