Is there a library like canvas2image (please look at createBMP function) for making .tiff in JavaScript (browser or nodejs)?
Native browser-support for tiff files is still pretty bad. Wikipedia has a nice overview regarding browser Image format support.
That being said; since a .tiff image is still essentially a raster-image, one could indeed convert it (the tricky part is stuff like supporting different compression-algorithms like PACKBITS, DEFLATE, LZW, etc) to another (browser-supported) raster-format (so one could feed it as a data:img
-source).
There is a library called Tiffus: a client side pure Javascript imaging library to load, save and manipulate binary images.
The original project aim was was to create a plain Javascript chrome extension which can convert single/multi page TIFF image/s to BMP/GIF image (this is where the name came from).
However now it supports:
and currently supports the folloing image functions:
Basically it works like this:
Note that according to the above; the author expects to use HTML5 Canvas ImageData
in the future.
Hope this helps!