license: GPL v2
Immaavs is based on the original Immaavs filter by E-Male, which can be found here. The provided source of E-Male is one that corresponds with one of the older versions of his plugin.
This plugin consists of two filters: ImmaRead and ImmaWrite. The former reads images and the latter writes images to your hard drive. ImmaRead supports the following formats:
Note that raw files are not supported by ImmaRead, but they can be opened by the plugin RawSource.
ImmaWrite supports the following formats:
Note that ImmaWrite doesn't support svg, wmf and raw digital photos.
All formats are opened as RGB32 (for greyscale images we have R=G=B) and for animations the number of frames is equal to the number of images within the animation.
You need the following ImageMagick dll's in order to be able to use this plugin. They should be copied to some folder (any folder will do). You need to set the MAGICK_HOME variable to the location of ImageMagick dll's (under Settings -> System -> Advanced -> Environment Variables -> Add MAGICK_HOME as a user variable), or you need to provide it using the magick_home argument. Thus for example, magick_home = "C:\\WINNT\\system32".
ImmaRead
(string filename, int start, int end,
int size_x,
int size_y, bool
animation, bool gapless,
int density, bool info, string magick_home)
ImmaWrite
(string filename, int start, int end,
string type, string mode, bool
animation, bool use_dither, int colors, bool planar,
int density, bool info, string magick_home)
ImmaRead
(string filename, int start, int end,
int size_x,
int size_y, bool
animation, bool gapless, bool info, string magick_home)
filename is the image or image sequence (multiple images) which should be read. For an image sequence, the frame number substitution should be specified using "sprintf syntax", or using wildcards (sorted by filename, subfolders are not included). For example, the files written by ImmaWriter's default parameters can be referenced with "c:\%06d.jpg" (meaning filenames with 6 digits, thus C:\000000.jpg, C:\000001.jpg, etc ...). The start and end of the image sequence should be specified with the start and end parameters. When (size_x, size_y) is not specified, the images in the sequence should have the same width and height, otherwise a black frame is returned with an error message. When (size_x, size_y) is specified, the images in the sequence are scaled to their maximum and black borders are added when necessary. Also if an image (within the sequence) doesn't exist, a black frame is returned with an error message.
When loading raw camera formats you need about 200 MB of free space in your C-folder.
start (default 0) and end (default 100) are the start and end of the frame range that will be written. These arguments are ignored when loading a single image or when animation=true.
size_x (default 0), size_y (default 0) enables you (when set to > 0) to force the size for the image which is being read. It's useful in the following two situations:
When setting size=0 it doesn't force anything.
animation (default false) reads the clip as animation when it is set as true. It's only available for gif, mng, ppm, psd and tiff. For ppm and tiff it writes a multipage file.
gapless (default false) removes non-existant images from your image sequence when it is set to true. When set to false you will get an error message if one of your images in your image sequence doen't exist.
density (default 100). This option specifies the canvas resolution while rendering vector formats such as PS, EPS, PDF, WMF and SVG. The higher the density the sharper the rendered image will be. I'm not sure how the density is related to the canvas resolution, but I think it is given by: width = 8.50 *density and height = 11.00 *density. (Warning: setting density higher than 120 could result in a crash when reading ps images.)
info (default false) writes the source filename (and the original and scaled size when (size_x, size_y) is specified) on each video frame when it is set to true.
magick_home (default empty): The plugin checks whether the IMAGE_MAGICK variable is set (if so, it should point to the location of ImageMagick dll's). If it's not set, you can set it (or override it) with this argument. Thus magick_home = "C:\\WINNT\\system32".
ImmaWrite
(string filename, int start, int
end, string type, string mode, bool
animation, bool use_dither, int colors, bool planar)
filename is the path + filename of the saved images (without extension). When animation=false, the images will have filenames as such: [file]000000.[type], [file]000001.[type], etc.
start and end are the start and end of the frame range that will be written. start defaults to 0 and end to the last frame of the input clip.
type is the filename extension and defines the format of the image (default "tiff"). Raw RGB(A) or YCbCr files (independing on the colorformat of the input clip) can be written using type="raw" (this can also be used in combination with mode="Grayscale", animation=true and planar=true).
mode specifies how the image pixels are stored in the image (provided it is supported by the image type). It can be "TrueColor" (24-bit RGB; default), "Bilevel" (1-bit black and white), "Grayscale" (8-bit Grayscale) or "Palette" (8-bit):
animation writes the clip as animation when it is set as true (it's false by default). It's only available for gif, mng, ppm, psd, raw, tiff and y4m. For ppm and tiff it writes a multipage file.
use_dither (default true). Dithering is used when reducing the number of colors. This can be done when specifying the colors option, or when using mode="Palette" (or when converting to a format which has 256 colors (like GIF)). When set to false, it will turn off dithering.
colors (default "the same as the input and what the output format permits" with a maximal of 256 colors). This option can be used to reduce the number of colors. Note that if you create an image sequence or an animation, it will save every frame using a distinct colorset (unless your source itself has already the specified number of different colors).
planar (default false). This option can be using when writing raw rgb(a) files. When set to true it will write planar BGR(A) files, otherwise it will write interleaved BGR(A) files.
density (default 100). This option sets the density for vector formats (like pdf). It doesn't do anything when setting it for rasterized images. The density (also called DPI or dots per inch) is just a flag and it tells you how (meaning at what size) it should be printed on or scanned from (for example) paper. So when the density of a 640x480 image it is set to 72 dpi for example, it means it should be printed at 640/72 (= 8,889) inches in width by 480/72 (= 6,676) inches in height.
info (default false). When set to true, it will overlay progress information on the video clip, showing whether a file is being written, and if so, the filename.
magick_home (default empty). The plugin checks whether the MAGICK_HOME variable is set in your environment variables (as a user variable) [this can be set in your Control Panel -> System -> Advanced -> Environment Variables]. If it is set, it should point to the location of ImageMagick dll's). If it's not set, you can set (or override) it with this argument. Thus for example magick_home = "C:\\WINNT\\system32", although it can be any folder.
A note about BMP. When creating a BMP as RGB24, it is saved as BMP3 (BMP with BITMAPINFOHEADER). When creating a BMP as RGB32 (thus with alpha channel), it is saved as BMP4 (BMP with a BITMAPV4HEADER). Using BMP3 for RGB32 will force it.
The framerate of an animation can be either constant of variable. Since AviSynth supports only constant framerate the following behaviour is implemented:
reading animations: If there is a delay between the first and second image in the animation, the framerate is set to 100 divided by the number of ticks (since 100 ticks equals 1 second). If the number of ticks is zero, the framerate is set to 25 fps (and can be adjusted by the user using AssumeFPS after reading the animation).
For non-animations, the framerate is set to 25 fps (and can be adjusted by the user using AssumeFPS after reading the animation).
writing animations: the number of ticks is set to 100/fps (where fps = fps_numerator/fps_denominator; and 100 ticks equals 1 second).
LoadPlugin("F:\CompilingPlugins\immaavs\Release\immaavs.dll") ImmaRead("F:\CompilingPlugins\immaavs\Release\001.jp2")
# returns the alpha channel of a tiff: LoadPlugin("F:\CompilingPlugins\immaavs\Release\immaavs.dll") ImmaRead("F:\CompilingPlugins\immaavs\Release\RGB24_alpha.tiff").ShowAlpha()
# reads an animated gif: LoadPlugin("F:\CompilingPlugins\immaavs\Release\immaavs.dll") ImmaRead("F:\CompilingPlugins\immaavs\Release\lion_animated.gif")
# reads an image sequence (pic02.jpg up to pic10.jpg) LoadPlugin("F:\CompilingPlugins\immaavs\Release\immaavs.dll") ImmaRead("F:\CompilingPlugins\immaavs\Release\pic%02d.jpg", start=2, end=10)
# reads an image sequence (pic01.jpg up to pic10.jpg, but pic01.jpg and pic05.jpg don't exist) LoadPlugin("F:\CompilingPlugins\immaavs\Release\immaavs.dll") ImmaRead("F:\CompilingPlugins\immaavs\Release\pic%02d.jpg", start=1, end=10, gapless=true) # 8 images are read
# reads all jpg images in the folder "F:\CompilingPlugins\immaavs\Release\", and scales them to (640,480) # (black borders are included to maintain the aspect ratio): ImmaRead("F:\CompilingPlugins\immaavs\Release\*.jpg", size_x=640, size_y=480)
# reads all jpg images starting with the name "pic" in the folder "F:\CompilingPlugins\immaavs\Release\": ImmaRead("F:\CompilingPlugins\immaavs\Release\pic*.jpg")
# reads a raw camera format image (CR2) were the ImageMagick dlls and xml files are located in the "F:\\ImageMagick" folder: Immaread("F:\TestPics\Camera\RAW_CANON_1DSM3.CR2", magick_home="F:\\ImageMagick")
# saves to 8-bit color palette (BMP): c = ColorBars().Trim(0,4) # RGB32 ImmaWrite(c.ConvertToRGB24, "cb", type="bmp", mode="Palette")
# saves to 8-bit greyscale (PNG) with alpha channel: c = ColorBars().Trim(0,4) # RGB32 ## creates circular gradient mask using the GraMaMa plugin: mask = c.ConvertToYV12(matrix="PC.601").GraMaMa(1, 320, 240, 240).ConvertToRGB32(matrix="PC.601").Levels(0, 1, 255, 255, 0) c2 = Mask(c, mask) ImmaWrite(c2, "cb_rgba", type="png", mode="Grayscale")
# saves to a multipage tiff: c = AviSource("F:\clip.avi").ConvertToRGB24() ImmaWrite(c, "test_multipage", type="tif", animation=true) # saves frames 1-10 to a sequence of tiff's: c = AviSource("F:\clip.avi").ConvertToRGB24() ImmaWrite(c, "test_seq", start=1, end=10, type="tif")
# saves to 8-bit color palette (BMP) and reducing the number of colors to 24: c = ColorBars().Trim(0,4) # RGB32 ImmaWrite(c.ConvertToRGB24, "cb", type="bmp", mode="Palette", colors=24)
# saves to a raw planar BGR file: c = ColorBars().Trim(0,-1) # RGB32 ImmaWrite(c.ConvertToRGB24, "cb_raw", type="raw", planar=true) # note that only interleaved rgb(a) files can be read by the plugin RawSource
# saves to a planar raw (planar) YV16 file: c = ColorBars().Trim(0,-1) # RGB32 ImmaWrite(c.ConvertToYUY2, "cb_raw", type="raw", planar=true) # can be opened by the plugin RawSource as "YV16"
# saves to a raw greyscale clip: c = ColorBars().Trim(0,4) # RGB32 ImmaWrite(c.ConvertToRGB24, "cb_raw", type="raw", mode="Grayscale", animation=true) # can be read by the plugin RawSource as "Y8"
# saves several freames to an 4:2:0 YUV4MPEG file: c = ColorBars(pixel_type="yv12").Trim(0,4) ImmaWrite(c, "cb_yv12", type="y4m", animation=true) # can be read by the plugin RawSource as "YV12" (other YUV4MPEG formats are not supported by RawSource)
error message | reason |
"ImmaRead: format (%s) not supported!" (with "%s" some image format) | The particular image format is not supported (yet). Not all formats that are supported in ImageMagick are supported in this plugin. Drop me a note when this is the case. |
"ImmaRead: images must have identical heights" | Not all images in the sequence have the same height. |
"ImmaRead: images must have identical widths" | Not all images in the sequence have the same width. |
"ImmaRead: couldn't open picture file: reason=UnableToOpenBlob 'pix03.jpg': No such file or directory" |
The image doesn't exist. Check whether the name is spelled correctly and whether it is located in the correct folder. |
"ImmaRead: couldn't open picture file: reason=NoDecodeDelegateForThisImageFormat 'pic03.jpg'" |
It can not find the delegate file which is used for decoding the image. In this case IM_MOD_RL_jpeg_.dll is missing. This file should be in your system folder or in the same folder as your image. |
"ImmaRead: couldn't open picture file: reason=MustSpecifyImageSize (...)" |
If you are trying to open the format svg, the ImageMagick libs can't get the size of the image. You can force it by using the "size" parameter. |
The dynamic link library CORE_RL_jpeg_.dll could not be found in the specified path ... | In this case, the CORE_RL_jpeg_.dll is missing. This file should be in your system folder or in the same folder as your image. |
ImmaRead/ImmaWrite: failed to set MAGICK_HOME variable, do this manually! | You tried to set the MAGICK_HOME variable using the magick_home argument, but for some reason it failed. Check the spelling. It also needs to be your system folder (or a subfolder of it), any other folder won't work. |
ImmaRead/ImmaWrite: you haven't set the MAGICK_HOME variable and you didn't provide it as argument! | You need to set the MAGICK_HOME variable (being the location of ImageMagick dll's) or provide it as an argument. |
![]() |
Such a message occurs when loading a raw camera image, and there is not enough free space in your C-drive. Make sure that you have at least about 200MB of free space. |
In order to compile this plugin you don't need to compile ImageMagick itself, but you need the following files:
The header files and libraries can be downloaded from here (compiled with VC6). Put them in some folder (say D:\IMAGEMAGICK-6.5.8), add D:\IMAGEMAGICK-6.5.8 to 'Directories -> Include files' (under Tools -> Options) and add D:\ImageMagick-6.5.8\VisualMagick\lib to 'Directories -> Library files'. Copy the dynamic link libraries to your system folder. Finally add the library module CORE_RL_magick_.lib in the Project Settings under the link tab.
In order to compile Immaavs you don't need to compile ImageMagick itself. However if you want to update the ImageMagick libraries you will need to compile ImageMagick. How this is done is described here.
The included ImageMagick libraries are Copyright © ImageMagick Studio LLC. Its license terms can be found here. The libraries (and dll's) are compiled with ImageMagick 6.5.8.
http://www.imagemagick.org/pipermail/magick-announce/2008-November/000043.html
CompressionType: http://bel.gsi.de/docs/imagemagick/www/api/types/Enumerations.html#CompressionType
http://www.imagemagick.org/script/command-line-options.php#compress
Types: http://www.graphicsmagick.org/api/types.html#pixelpacket
OpenEXR: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=14520
v1.51, 17th July 2010
v1.50, 22th November 2009
v1.41, 20th December 2008
v1.40, 9th December 2008
v1.36, 27th August 2008
v1.35, 24th August 2008
v1.34, 9th August 2008
v1.33, 29th June 2008
v1.32, 27th May 2008
v1.31, 20th May 2008
v1.30, 17th April 2008
v1.21, 2nd April 2008
v1.2, 23th March 2008
v1.1, 16th March 2008
v1.0, 24st January 2006