Platforms to show: All Mac Windows Linux Cross-Platform
Back to TiffPictureMBS class.
TiffPictureMBS.GetFieldString(Tag as Integer, byref value as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 8.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.
The string is returned with ascii encoding. You may need to define a different encoding is this is not correct.
Some examples using this method:
TiffPictureMBS.GetXMP as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 7.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns "" on any error.
TiffPictureMBS.ImageCount as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns 0 on any error.
TiffPictureMBS.ImageIndex as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
0 based.
TiffPictureMBS.IsLastImage as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Useful if you walk through all pictures using NextImage.
TiffPictureMBS.MirrorVertical(output as TiffPictureMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 7.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
You may be able to pass the current tiff file as the output one if you have it open for read and write.
Returns true on success and false on failure.
Works for any color depth or color mode.
TiffPictureMBS.NextImage as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
See also:
TiffPictureMBS.NextImage(HeaderOnly as boolean) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If HeaderOnly is false the current picture is read into the pict&mask properties.
See also:
TiffPictureMBS.Open(file as folderitem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
You need to use the ReadRGB method or the Scanline property to get data from this file.
Returns true on success.
See also:
TiffPictureMBS.Open(file as folderitem, Mode as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 5.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other Open method, but you can pass a mode string to the library.
The open mode parameter can include the following flags in addition to the "r" (Read), "w" (Write), and "a" (Append) flags. Note however that option flags must follow the read-write-append specification.
l | When creating a new file force information be written with Little-Endian byte order (but see below). By default the library will create new files using the native CPU byte order. |
b | When creating a new file force information be written with Big-Endian byte order (but see below). By default the library will create new files using the native CPU byte order. |
L | Force image data that is read or written to be treated with bits filled from Least Significant Bit (LSB) to Most Significant Bit (MSB). Note that this is the opposite to the way the library has worked from its inception. |
B | Force image data that is read or written to be treated with bits filled from Most Significant Bit (MSB) to Least Significant Bit (LSB); this is the default. |
H | Force image data that is read or written to be treated with bits filled in the same order as the native CPU. |
M | Enable the use of memory-mapped files for images opened read-only. If the underlying system does not support memory-mapped files or if the specific image being opened cannot be memory-mapped then the library will fallback to using the normal system interface for reading information. By default the library will attempt to use memory-mapped files. |
m | Disable the use of memory-mapped files. |
C | Enable the use of "strip chopping" when reading images that are comprised of a single strip or tile of uncompressed data. Strip chopping is a mechanism by which the library will automatically convert the single-strip image to multiple strips, each of which has about 8 Kilobytes of data. This facility can be useful in reducing the amount of memory used to read an image because the library normally reads each strip in its entirety. Strip chopping does however alter the apparent contents of the image because when an image is divided into multiple strips it looks as though the underlying file contains multiple separate strips. Finally, note that default handling of strip chopping is a compile-time configuration parameter. The default behaviour, for backwards compatibility, is to enable strip chopping. |
c | Disable the use of strip chopping when reading images. |
See also:
TiffPictureMBS.Open(Path as String, Mode as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 19.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other Open method, but you can pass a mode and path as string to the library.
The open mode parameter can include the following flags in addition to the "r" (Read), "w" (Write), and "a" (Append) flags. Note however that option flags must follow the read-write-append specification.
l | When creating a new file force information be written with Little-Endian byte order (but see below). By default the library will create new files using the native CPU byte order. |
b | When creating a new file force information be written with Big-Endian byte order (but see below). By default the library will create new files using the native CPU byte order. |
L | Force image data that is read or written to be treated with bits filled from Least Significant Bit (LSB) to Most Significant Bit (MSB). Note that this is the opposite to the way the library has worked from its inception. |
B | Force image data that is read or written to be treated with bits filled from Most Significant Bit (MSB) to Least Significant Bit (LSB); this is the default. |
H | Force image data that is read or written to be treated with bits filled in the same order as the native CPU. |
M | Enable the use of memory-mapped files for images opened read-only. If the underlying system does not support memory-mapped files or if the specific image being opened cannot be memory-mapped then the library will fallback to using the normal system interface for reading information. By default the library will attempt to use memory-mapped files. |
m | Disable the use of memory-mapped files. |
C | Enable the use of "strip chopping" when reading images that are comprised of a single strip or tile of uncompressed data. Strip chopping is a mechanism by which the library will automatically convert the single-strip image to multiple strips, each of which has about 8 Kilobytes of data. This facility can be useful in reducing the amount of memory used to read an image because the library normally reads each strip in its entirety. Strip chopping does however alter the apparent contents of the image because when an image is divided into multiple strips it looks as though the underlying file contains multiple separate strips. Finally, note that default handling of strip chopping is a compile-time configuration parameter. The default behaviour, for backwards compatibility, is to enable strip chopping. |
c | Disable the use of strip chopping when reading images. |
See also:
TiffPictureMBS.OpenString(data as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 5.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the Open() function, but memory based. You can now use functions like Scanline(), ReadSW() or ReadRGB() to get the picture data.
Returns true on success.
The Warning and Error events may show you reasons why it does not work.
The string you pass is saved in the data property of the class for later use.
You can and should use this function to write yourself a TiffStringToPicture function.
See also:
TiffPictureMBS.OpenString(data as string, Mode as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 5.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other OpenString method, but you can pass a mode string to the library.
See also:
TiffPictureMBS.RawStripSize(strip as UInt32) as UInt64
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
TiffPictureMBS.ReadBW as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.
Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.
This method uses the YieldTicks property and may yield time to other threads.
See also:
Some examples using this method:
TiffPictureMBS.ReadBW(left as Integer, top as Integer, width as Integer, height as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.
Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.
This method uses the YieldTicks property and may yield time to other threads.
See also:
TiffPictureMBS.ReadEncodedStrip(strip as UInt32, byref data as Memoryblock) as UInt32
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Read the specified strip of data and place up to size bytes of decompressed information in the (user supplied) data buffer.
The value of strip is a "raw strip number". That is, the caller must take into account whether or not the data are organized in separate planes (PlanarConfiguration=2). To read a full strip of data the data buffer should typically be at least as large as the number returned by StripSize.
The library attempts to hide bit- and byte-ordering differences between the image and the native machine by converting data to the native machine order. Bit reversal is done if the FillOrder tag is opposite to the native machine bit order. 16- and 32-bit samples are automatically byte-swapped if the file was written with a byte order opposite to the native machine byte order,
Returns the actual number of bytes of data that were placed in buf is returned; ReadEncodedStrip returns -1 if an error was encountered.
TiffPictureMBS.ReadEncodedTile(tile as UInt32, byref data as Memoryblock) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Read the specified tile of data and place up to size bytes of decompressed information in the (user supplied) data buffer.
The value of tile is a "raw tile number". That is, the caller must take into account whether or not the data are organized in separate planes (PlanarConfiguration=2). ComputeTile automatically does this when converting an (x,y,z,sample) coordinate quadruple to a tile number. To read a full tile of data the data buffer should be at least as large as the value returned by TileSize.
The library attempts to hide bit- and byte-ordering differences between the image and the native machine by converting data to the native machine order. Bit reversal is done if the FillOrder tag is opposite to the native machine bit order. 16- and 32-bit samples are automatically byte-swapped if the file was written with a byte order opposite to the native machine byte order,
Returns the actual number of bytes of data that were placed in buf is returned; ReadEncodedTile returns −1 if an error was encountered.
TiffPictureMBS.ReadPreviewBW as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method is faster than ReadBW, because it reads only every 8th line and every 8th pixel in each row. So the picture you get is much smaller, but may be enough for a preview.
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.
Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.
This method uses the YieldTicks property and may yield time to other threads.
See also:
Some examples using this method:
TiffPictureMBS.ReadPreviewBW(left as Integer, top as Integer, width as Integer, height as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method is faster than ReadBW, because it reads only every 8th line and every 8th pixel in each row. So the picture you get is much smaller, but may be enough for a preview.
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.
Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.
This method uses the YieldTicks property and may yield time to other threads.
See also:
TiffPictureMBS.ReadPreviewRGB(ReduceFactor as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method is faster than ReadRGB, because it reads only every ReduceFactorth line and every ReduceFactorth pixel in each row. So the picture you get is much smaller, but may be enough for a preview.
Returns true on success.
ReadRGB does converting on the picture data if needed so you can read CMYK, RGB, BW and other image data using this function.
This function works with most Tiff formats, but has problems with some like 16 bit CMYK.
Some examples using this method:
TiffPictureMBS.ReadRawStrip(strip as UInt32, byref data as Memoryblock) as UInt32
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Read the contents of the specified strip into the (user supplied) data buffer. Note that the value of strip is a "raw strip number". That is, the caller must take into account whether or not the data is organized in separate planes (PlanarConfiguration=2). To read a full strip of data the data buffer should typically be at least as large as the number returned by StripSize.
Returns the actual number of bytes of data that were placed in buf is returned; ReadEncodedStrip returns -1 if an error was encountered.
TiffPictureMBS.ReadRawTile(tile as UInt32, byref data as Memoryblock) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Read the contents of the specified tile into the (user supplied) data buffer. Note that the value of tile is a "raw tile number". That is, the caller must take into account whether or not the data is organized in separate planes (PlanarConfiguration=2). ComputeTile automatically does this when converting an (x,y,z,sample) coordinate quadruple to a tile number. To read a full tile of data the data buffer should typically be at least as large as the value returned by TileSize.
Returns the actual number of bytes of data that were placed in buf is returned; ReadEncodedTile returns −1 if an error was encountered.
TiffPictureMBS.ReadRGB as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success.
ReadRGB does converting on the picture data if needed so you can read CMYK, RGB, BW and other image data using this function.
This function works with most Tiff formats, but has problems with some like 16 bit CMYK.
See also:
Some examples using this method:
- /Images/JPEG/Quickly generate previews for JPEG and Tiff
- /Images/LargePicture/Tiff Load and Save
- /Images/LCMS2/Convert image to sRGB JPEG
- /Images/Tiff/BigTiff Test
- /Images/Tiff/Quickly generate previews for JPEG and Tiff
- /Images/Tiff/TIFF Picture Info
- /Images/Tiff/Tiff Speed Test
- /MacCG/CoreImage/Quickly generate previews for JPEG and Tiff
TiffPictureMBS.ReadRGB(byref ErrorMessage as string, Dest as MemoryBlock = nil) as memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The Scanline() array gives you the raw uncompressed data. But this method decodes the data into a RGBA image.
The Memoryblock has the size of 4*width*height. Each pixel has one byte for red, one byte for green, one byte for blue and one byte for alpha. If no alpha is in the file, all pixels have the same alpha of 255.
If the decompression fails the function returns nil. (e.g. out of memory).
If the decoding fails, you also get an error message.
This function works with most Tiff formats, but has problems with some like 16 bit CMYK.
If dest is not nil and big enough, the plugin will use it and return it on success. This can avoid additional memory allocations which can cost CPU time (especially to clear the bytes).
See also:
TiffPictureMBS.ReadRGBMemoryBegin(byref ErrorMessage as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 10.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Like ReadRGB, but with ReadRGBMemoryBegin, ReadRGBMemoryEnd and ReadRGBMemoryStep you can read the RGBA data in portions.
The Memoryblock returned by ReadRGBMemoryStep has the size of 4*width*height. Each pixel has one byte for red, one byte for green, one byte for blue and one byte for alpha. If no alpha is in the file, all pixels have the same alpha of 255.
If the decompression fails the function returns false. (e.g. out of memory).
If the decoding fails, you also get an error message.
This function works with most Tiff formats, but has problems with some like 16 bit CMYK.
TiffPictureMBS.ReadRGBMemoryEnd
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 10.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
TiffPictureMBS.ReadRGBMemoryStep(x as Integer, y as Integer, width as Integer, height as Integer, Dest as MemoryBlock = nil) as memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 10.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
As you see in the example, you can use this method to easily read huge TIFF files into a PictureMBS object.
If the decompression fails the function returns nil. (e.g. out of memory).
Please make sure that the range in x and y, width and height is right.
If dest is not nil and big enough, the plugin will use it and return it on success. This can avoid additional memory allocations which can cost CPU time (especially to clear the bytes).
TiffPictureMBS.ReadWithLUT(ColorLookupTable() as color) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Works with 8, 16 amd 32 bits per sample. And with 1 or 3 samples per pixels (Gray or RGB). The lookup table has 256 entries for 8 bit and 65536 entries for 16/32 bit.
This method uses the YieldTicks property and may yield time to other threads.
See also:
Some examples using this method:
TiffPictureMBS.ReadWithLUT(ColorLookupTable() as color, left as Integer, top as Integer, width as Integer, height as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 9.8 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Works with 8, 16 amd 32 bits per sample. And with 1 or 3 samples per pixels (Gray or RGB). The lookup table has 256 entries for 8 bit and 65536 entries for 16/32 bit.
This method uses the YieldTicks property and may yield time to other threads.
See also:
TiffPictureMBS.RewriteDirectory as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 8.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
As the data is added to the file and just the reference to the old data is deleted, the filesize will grow.
Calls TIFFReWriteDirectory internally. Same as SaveImage.
Some examples using this method:
TiffPictureMBS.SaveImage as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 7.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
As the data is added to the file and just the reference to the old data is deleted, the filesize will grow.
Calls TIFFReWriteDirectory internally. Same as RewriteDirectory.
TiffPictureMBS.Scanline(index as Integer, sample as Integer = 0) as memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | TIFF | MBS Images Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns nil on any error.
If you set the value, make sure the Memoryblock is big enough. The BytesPerRow functions returns the number of bytes needed.
The data for this property is stored in the Tiff file.
The first scanline has the index of 0.
(Read and Write computed property)
See also:
Some examples using this property:
- /DynaPDF/CMYK Pictures/Create PDF with CMYK
- /Images/LargePicture/CMYK/PictureMBS with CMYK
- /Images/LargePicture/PictureMBS filters
- /Images/LargePicture/PictureMBS rotate benchmark
- /Images/LargePicture/Tiff Load and Save
- /Images/LCMS2/Convert image to sRGB JPEG
- /Images/Tiff/Huge Tiff
- /Images/Tiff/Tiff Combine
- /Images/Tiff/Tiff Copy Test/Tiff Copy Test
- /Images/Tiff/TIFF Split
TiffPictureMBS.Scanline(mem as Ptr, index as Integer, sample as Integer = 0) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | TIFF | MBS Images Plugin | 11.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false on any error.
Thee Memoryblock must be big enough. The BytesPerRow functions returns the number of bytes needed.
The first scanline has the index of 0.
This is the fastest way to read scanlines. You provide the memoryblock and you can reuse it for all calls to this method for one tiff.
See also:
The items on this page are in the following plugins: MBS Images Plugin.