Wed 28 Nov 2012 07:09:29 PM UTC, comment #1:
So, I looked into the imread functionality a bit. Here is what I came up with. The Matlab spec has the abbreviated functionality for imread for the different image formats that it supports:
BMP — Windows Bitmap
CUR — Cursor File
(..., idx)
GIF — Graphics Interchange Format
(..., idx) idx is a scalar integer or a vector of integer values
(..., 'frames', idx) same as above. idx can be 'all'
HDF4 — Hierarchical Data Format
(..., ref) get the ref image. not necessarily in order
ICO — Icon File
JPEG — Joint Photographic Experts Group
JPEG 2000 — Joint Photographic Experts Group 2000
(..., 'p1','v1','p2','v2',... )
'ReductionLevel' - non-negative integer
'PixelRegion' - {ROWS, COLS} - 2 element vectors representing [START, STOP]
PBM — Portable Bitmap
PGM — Portable Graymap
PNG — Portable Network Graphics
(..., 'BackgroundColor', BG ) - pretty complicated.
PPM — Portable Pixmap
RAS — Sun Raster
PCX — Windows Paintbrush
TIFF — Tagged Image File Format
(..., 'p1','v1','p2','v2',... )
'Index' -> integer for value
'Info' - structure from imfinfo - improves perf
'PixelRegion' - {ROWS, COLS} - 2 or 3 element vectors
XWD — X Window Dump
=================================
In the Octave code there seems to be very limited support for any of the additional functionality for the different formats. In fact the only additional functionality is the GIF support, 'frames' and 'all', which is transparently passed through to all formats. It is not clear what GraphicsMagick does with the image index/number information on all formats. Probably ignores it.
My solution to the problem is to add a check for "Image" so that imread acts the same as if "frames" were passed in.
The default behaviour is to notice that there were 3 parameters passed in, but since the second was not "frames" silently error out and return the first image. Unexpected behaviour is a poor user experience.
The only functionality seems to be
" (..., idx) " for all the format
|