octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: interested in "image IO" for GSoC 2015


From: Daniel
Subject: Re: interested in "image IO" for GSoC 2015
Date: Wed, 15 Apr 2015 01:12:12 -0400



On Wed, Mar 25, 2015 at 8:46 AM, Carnë Draug <address@hidden> wrote:
Better to keep the maintainers mailing list on CC.  Also, on the Octave
mailing list, etiquete is to do interleaved or bottom posting which makes
conversations easier to follow:



A bit background for someone who is not familiar. Current image IO is done by GraphicsMagic, one of the limitations is the bitdepth vs memory usage compromise. Another one is GM does not support floating point tiff. It would be more flexible and finer-tuned if we implement our own Image I/O in C++, maybe based on some existing library, e.g, for TIFF, there exists libtiff. These have been mentioned by Carnë Draug 
<http://wiki.octave.org/Summer_of_Code_Project_Ideas>

So I started to try a bit on libtiff. Funny enough, only after I compiled a latest version 4.0.4, then I found my linux had already installed libtiff before. I have no clue with which software it got installed along.

%-------
Enable runtime linker paths:        no
Enable linker symbol versioning:    no
Use win32 IO:                       no
JPEG 8/12 bit dual mode:            no
OpenGL support:                     no
%-------

As shown above, I built the libtiff 4.0.4 with all other default options 'YES' the disabled ones are listed above.  Then I was able to modify and ran some sample code they provided; <http://www.libtiff.org/libtiff.html>
so very simple calculation of tiff image can be done. It is fairly easy to use it in a very basic way. 
There also exist some examples using or associated with libtiff library to read/write tiff files. 
e.g., in contrib, 'stream' is a class (TiffStream) for accessing TIFF files through a C++ stream interface.  I think these information would be useful for writing a wrapper targeting to octave.  

Worth-noting, some of the potential issues could be due to _TIFFmalloc_TIFFrealloc, and _TIFFfree which seems to be machine-specific in the sense that they mimic the normal ANSI C routines on differentl platforms differently; special cares will be taken.

The ease of use of the library is also obvious, several most frequently used ones would be: "tiffio.h, tiff.h"
any of the so-called device-independent "Tools" < http://www.libtiff.org/tools.html > listed in their webpage would be readily available for our use .

tiffinfoDisplay information about one or more TIFF files.
tiffdumpDisplay the verbatim contents of the TIFF directory in a file (it's very useful for debugging bogus files that you may get from someone that claims they support TIFF)
tiffcpCopy, concatenate, and convert TIFF images (e.g. switching from Compression=5 to Compression=1)
tiff2psConvert TIFF images to PostScript
tiffcmpCompare the contents of two TIFF files (it does not check all the directory information, but does check all the data)
tiff2bwA simple program to convert a color image to grayscale
ras2tiffA quick hack that converts Sun rasterfile format images to TIFF -- it's less than complete
rgb2ycbcrConvert an RGB, grayscale, or bilevel TIFF image to a YCbCr TIFF image; it's mainly provided for testing
gif2tiffA quick hack that converts GIF 87a format images to TIFF
ppm2tiffA quick hack that converts PPM format images to TIFF
fax2tiffConvert raw Group 3 or Group 4 facsimile data to TIFF
pal2rgbConvert a Palette-style image to a full color RGB image by applying the colormap
tiffditherDither a b&w image into a bilevel image (suitable for use in creating fax files)
tiffsplitCreate one or more single-image files from a (possibly) multi-image file
fax2psConvert a Group 3- or Group 4- compressed TIFF to PostScript that is significantly more compressed than is generated by tiff2ps (unless tiff2ps writes PS Level II)
thumbnailCopy a bilevel TIFF to one that includes 8-bit greyscale "thumbnail images" for each page; it is provided as an example of how one might use the SubIFD tag (and the library support for it)
tiffmedianA version of Paul Heckbert's median cut program that reads an RGB TIFF image, and creates a TIFF palette file as a result; it's useful for converting full-color RGB images to 8-bit color for your friends that have cheapo 8-bit framebuffers.
sgi2tiffA program to convert SGI image files to TIFF. This program is only useful on SGI machines as it uses -limage.

Afterwards I also looked into liboctave and try to understand more about libtiff (primarily in C), but I get lost easily in both cases. So far I am not very clear about how/where to integrate the image IO wrapper class or any C++ component into the core. I may need at least one entire week on my own to understand the necessary stuff that I need to know. But after that I believe it will just be a matter of writing the code and testing. Meanwhile, several other libraries can be used as reference ImageMagickGraphicsMagickNetPBM and VIPS.


classdef in octave seems rather new. I am not sure how well I can master it in short term. I did not use this functionality before, neither in ML.

I am able to fully dedicate the summer to the project. But recently I do not have much free time before the finals. Further, there are several functions in the image package that I am particularly interested in, but for the same reason, I have not been able to touch them. Maybe I can try to make some time in the future or soon.

 For the GSOC, I am very interested in it, if that's not too late. Based on the very preliminary studies above, I realized that I cannot do everything during the summer.If I have to change the image IO proposal, I would cut it to a much shorter list, do only one thing and do it well. For example, to implement the image IO class and related interface only. If really have more time, converting BioFormat could be started during the summer. For all other related, I can keep working after the summer upon request of my image analysis project or other people's need.

Interestingly, libtiff size limitation currently is 4Gbytes with 32 bit offset (if using unsigned int). Go beyond 4G (up to 64 bit), you could want to try BigTIFF <http://bigtiff.org/> , consider someone may like 'big data'.

Daniel 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]