0

I tried OpenCV in vain to save indexed8bpp image with a colormap as a tif file. For this project, GDI+ is not an option. I already downloaded libtiff library, but it seems too big for me.

Is there anything else? I am not as picky as I would sound. :-)

Tae-Sung Shin
  • 20,215
  • 33
  • 138
  • 240

1 Answers1

1

libtiff is too big, but OpenCV is not?? I'd have thought that OpenCV is even bigger.

I would certainly use libtiff, and I recommend you give it a second chance. It really is the authority on writing TIFF files.

Besides, you're only going to be linking to a small part of it, so its size is not going to bloat your application. I'm not sure if that's what you meant about being too big... Perhaps you meant that you don't want to put all those sources in the version control for your project and you also don't want to stipulate a dependency on an external lib.

If your lack of pickiness extends to possibly not using TIFFs, then you could always use BMP. It's very easy to write indexed BMP files =)

paddy
  • 60,864
  • 6
  • 61
  • 103
  • 1
    Well, what I tend to do when I get hold of these things is look around for an example usage that does close to what I want. Then I massage that to do my bidding, throw it into a little wrapper function, and never have to worry about it again... Ideally you wanna make something like `WriteTiffIndexed256( const char *filename, const char *bytes, int width, int height )`. – paddy Oct 05 '12 at 03:56