.Tiff library for Javascript

Is there a library like canvas2image (please look at the createBMP function) for creating .tiff in JavaScript (browser or nodejs)?

+4
source share
1 answer

The native browser support for tiff files is still pretty bad. Wikipedia has a good browser overview. Image format support .

It is said; since the .tiff image is still a bitmap, it can really be converted (the hard part is something like supporting various compression algorithms such as PACKBITS, DEFLATE, LZW, etc.) in another (supported by the browser) bitmap format (therefore, you can feed it as a data:img source).

There is a library called Tiffus : a client-side Javascript image library for loading, saving, and manipulating binary images.

The initial goal of the project was to create a simple Javascript chrome extension that can convert single / multi-page TIFF images to BMP / GIF images (where the name comes from).

However, it now supports:

  • BMP for Windows (no compression, RLE)
  • OS / 2 BMP
  • ICO
  • GIF
  • Jpeg
  • PNG
  • Tiff

and currently supports the following image features:

  • load
  • save
  • resize
  • flip
  • invert color

It basically works as follows:

  • The original image is loaded as binary data using XMLHttpRequest using MimeType ('text / plain; charset = x-user-defined'); (future: HTML5 Canvas ImageData)
  • Image Processing Using Tiffus
  • Final image displayed as data URI scheme (future: HTML5 Canvas ImageData)

Please note that according to the above; author expects to use HTML5 Canvas ImageData in the future.

Hope this helps!

+3
source

Source: https://habr.com/ru/post/1442964/


All Articles